Template talk:W

Latest comment: 8 months ago by JasonHK in topic Expansion (C)

Documentation edit

{{edit protected}} Please move the documentation to a {{Documentation}} subpage. Rd232 (talk) 21:29, 26 June 2011 (UTC)Reply

  Done But you could have created the documentation subpage by yourself, leaving just the final protected page edit to an admin… --Mormegil (talk) 12:27, 30 June 2011 (UTC)Reply
Thanks. Didn't occur to me, as on non-protected pages I do both things together. Rd232 (talk) 12:31, 30 June 2011 (UTC)Reply

Required expansions edit

  1. The template would give an easy access also to main pages when transclusion was allowed with the page name empty: {{{1|}}} (with pipe) instead of {{{1}}}.
  2. It seems better documented when parameter 3 is inserted, instead of replacing the redundant "w". Or is the piping a "cheaper" (server friendly) way for replacing empty parameters?

The code should be simply
[[:{{#if:{{{3|}}}|{{{3}}}:|w:}}{{{1|}}}{{#if:{{{2|}}}|{{!}}{{{2}}}}}]]
If there are any questions, everything is explained at {{Wpd}}, a candidate for deletion.

If it seems better, safesubst may be inserted:
[[:{{<includeonly>safesubst:</includeonly>#if:{{{3|}}}|{{{3}}}:|w:}}{{{1|}}}{{<includeonly>safesubst:</includeonly>#if:{{{2|}}}|{{!}}{{{2}}}}}]]

Template U edit

{{U}} (has not yet a talk page) would function better with a small extension. At the moment it is internationalized with the named parameter LANG= instead with 3= as all the other templates. The extension ensures that older invocations with LANG= work as well as newer ones with 3=. The complete coding is provided there. If it seems better, safesubst may be inserted at any of the three #if:, or piping may be used istead.

Another advantage might be to divide it into the mere code, and the (unprotected) documentation page, which I shall maintain then. -- sarang 사랑 12:04, 27 February 2012 (UTC)Reply

I didn't understand the first part of that. But I've transcluded the documentation page you created, and you can create the template talk page Template talk:U for further discussion. Rd232 (talk) 22:10, 27 February 2012 (UTC)Reply
OK,   Done both. Rd232 (talk) 04:41, 29 February 2012 (UTC)Reply

Main galleries: edit

Should "Wikipedia" be added before the source for this template to provide context? Hyacinth (talk) 22:46, 20 March 2012 (UTC)Reply

I don't think we really want to change the behaviour of a template like that, and making it an option is probably not useful. Rd232 (talk) 09:45, 21 March 2012 (UTC)Reply
Not in the template itself by default. --AVRS (talk) 10:21, 21 March 2012 (UTC)Reply

"En:" vs. Template:W edit

What is the point of this template when one can use "en:"? The difference should be pointed out by Template:W/doc. Hyacinth (talk) 06:59, 30 April 2012 (UTC)Reply

For example User:Hyacinth vs. User:Hyacinth ([[en:User:Hyacinth|User:Hyacinth]] vs. {{w|User:Hyacinth}}). Hyacinth (talk) 07:55, 11 May 2012 (UTC)Reply

Not to mention w: works as well. User:Hyacinth ([[w:User:Hyacinth|]]) –Krinkletalk 20:29, 9 June 2012 (UTC)Reply
Works, but duplicates the name when you save. --AVRS (talk) 11:25, 10 June 2012 (UTC)Reply
Not to put too fine a point on it, but so what? Powers (talk) 18:54, 8 December 2012 (UTC)Reply
That makes the source text harder to read. --AVRS (talk) 19:14, 8 December 2012 (UTC)Reply
No more than "{{W|...}}" does, does it? Powers (talk) 19:52, 9 December 2012 (UTC)Reply
That all looks complicated – why not {{U|Hyacinth||en}} or {{U|Hyacinth|lang=en}} ? It will give Hyacinth exactly as above.
When the display of the namespace is wanted, use {{U|Hyacinth|+|en}}. --User talk:Sarang| sarang]]사랑 13:06, 9 August 2020 (UTC)Reply

Usefulness if using all 3 parameters⁇ edit

This template is only for text-reduction (and so maybe typing-help). But if we use all 3 parameters, then there is no single advantage(?), on the contrary, this is extra syntax which needs extra (computing power and) human instructions. So I suggest to deprecate the usage of 3 parameters. For example:

[[:de:Wappen der Landeshauptstadt München|Wappen von München]] vs
{{w|Wappen der Landeshauptstadt München|Wappen von München|de}} or
{{wd|Wappen der Landeshauptstadt München|Wappen von München}}.

Unfortunately the 3. is the more important language code. The 2. parameter (displayed text) is only prior if we link to the EnWP, because the 3rd parameter is needless.
Additional also the shortcut codes (wd, wf) are possibly colliding with the scheme of reserved language codes (2 letter templates). User: Perhelion 14:16, 30 July 2016 (UTC)Reply

AFAIK only wa and wo are reserved language codes. -- sarang사랑
The 2. Parameter was inserted by an IP 01-2007 and shortly thereafter Menasim 05-2007 inserted the 3. parameter .
The usage of the 2. parameter seems a inclusion of 12.000 (which are ~1.5% of all inclusions and ~ 0.365‰ of all files in near 10 years, insource:/\{\{[Ww]\|[^321][^=|}]+\|[^=|}]+(\|3?=?\w\w)?\}\}/ hastemplate:w) (on file-namespace) so it seems be a transmitted logic (although the most are without language code).
Although [[w:xxx|zzz]] is the same as {{w|xxx|zzz}}
User: Perhelion 08:41, 2 August 2016 (UTC)Reply

Expansion for better formatting edit

{{Editrequest}}

Please replace the code of the template with

[[:{{{3|w}}}:{{{1|}}}|{{<includeonly>safesubst:</includeonly>#if: {{{2|}}} |{{{2}}}|{{PAGENAME:{{{1|{{Projectname|w}}}}}}}}}]]<noinclude>
{{documentation}}
</noinclude>

Explanation: after insertion of the PAGENAME trick the display will avoid the understrokes, like all other Interwiki link templates
Example: List_of_XML_and_HTML_character_entity_references. -- sarang사랑 15:32, 1 November 2016 (UTC)Reply

  Done --jdx Re: 22:58, 12 November 2016 (UTC)Reply

The display is now successfully improved. Nevertheless more improvements seem desirable:

  1. When parameter 1 is expressed in lower case, it should be displayed also in lower case - without the need for parameter 2.
  2. When parameter 1 is specified explicitly with a namespace, it seems better to have the display prefixed with it as well.
  3. When parameter 1 is recognized as wrong defined that it is impossible to work with it, this should lead to an error msg.

The template will be a bit more complicated with these improvements but it will work better in the cases mentioned above. sarang사랑 16:39, 18 November 2016 (UTC)Reply

The above point (3.) is temporarely resolved; when parameter 1 starts with either "[" or "{" it is

  • either an edit error causing that the template cannot preceed; an error message is displayed and the page is categorized Maintenance:Template W error.
  • or it is "{"-code within a template that can probably be resolved when transcluded; such occurencies in namespace 10 should not cause a display or categorizing. It is possible to avoid the display by e.g. setting the parameter into nowiki. --sarang사랑 17:16, 15 May 2017 (UTC)Reply
  • OT (just my2¢): For me the template is groundless if parameter 2 is present (against native Wiki syntax, but this is may very to late to fix). Also parameter 3. is more useful and may more used as parameter 2. -- User: Perhelion 00:56, 16 May 2017 (UTC)Reply
In the special case of the {{W}} the language code may be of more importance; but since all other international templates have this code as an unnamed parameter 3, it follows this scheme. -- sarang사랑 15:13, 25 June 2017 (UTC)Reply

Expansion edit

{{Editrequest}} Please expand the template by copying the W/sandbox. The new parameter is needed for a special usage with namespaces. -- sarang사랑 15:13, 25 June 2017 (UTC)Reply

  Done Thank you! -- User: Perhelion 08:44, 29 June 2017 (UTC)Reply

Better usability: Line 2, instead of

-->|{{#ifeq:{{{link}}}|no|{{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}<!-- option for only text without link 

change to

-->|{{#switch:{{{link}}}|no|n|-={{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}<!-- option for only text without link 

— Preceding unsigned comment added by Sarang (talk • contribs) 30 May 2019, 11:30 (UTC)

  Done --Majora (talk) 00:08, 29 June 2019 (UTC)Reply

Expansion impossible? edit

As mentioned on the ns-10 page, since long exist the abbreviation {{Wt}} for a link to wiktionary. But there are a lot of other projects, where a link template might be useful, as

  1. wikibooks
  2. wikidata
  3. wikimedia and meta-wikimedia
  4. wikinews
  5. wikiquote
  6. wikispecies
  7. wikisource
  8. wikiversity
  9. wikivoyage

to wikipedia (W} and wiktionary (Wt). But not only that some letters are not unique ("V" for versity and voyage, "S" for species and source) there are some of these abbreviations heavily used for other things, e.g. {{Ws}} and {{WS}}. So it is also not an option to use WB, WD, WM, WN..., id won't avoid conflicts with existing templates.
Another letter than Wx seems not useful for Wiki projects. So no help can be offered to write the complicated links more comfortable. -- sarang사랑 13:06, 9 August 2020 (UTC)Reply

Expansion (C) edit

Editrequest Please expand the template by copying the well tested W/sandbox. A new parameter allows categorizing. -- sarang사랑 09:53, 29 June 2023 (UTC)Reply

@Sarang Hello, just want to inform you your latest expansion broke most of the shorthand templates like {{wz|...}}. Please refer to the "see also" section on the template page. <JasonHK ✉️ 📝 /> 18:39, 28 July 2023 (UTC)Reply
@JasonHK: Thank you for telling. Since I expanded now Wz, does it work correctly?
I have to expand all the W× templates, for full optionality, but it should do as until now without. -- sarang사랑 11:01, 29 July 2023 (UTC)Reply
@Sarang Thanks, it works perfectly now! <JasonHK ✉️ 📝 /> 09:05, 30 July 2023 (UTC)Reply
Return to "W" page.