Template talk:TemplateBox

From Wikimedia Commons, the free media repository
Jump to: navigation, search

Edit links[edit]

All the edit links except the first one go to {{TemplateBox/layout}}. Rocket000 (talk) 06:14, 6 August 2009 (UTC)

I added a NOEDITSECTION statement. --Slomox (talk) 10:42, 6 August 2009 (UTC)
That works. Sectional [edit] buttons didn't make sense anyway since what you're editing (one giant template) looks nothing like what you see. Thanks. Rocket000 (talk) 22:39, 6 August 2009 (UTC)
Edit links make sense on sections of template pages and template documentation pages after the result of TemplateBox. As a workaround I created Template:Sed.--Patrick (talk) 09:09, 20 September 2010 (UTC)

Issue #2[edit]

Sorry I'm filing another bug report (maybe not the template's fault) but I tried to follow the chain of templates yet I can't find the source of the problem. See Template:Meta information museum. It's showing what the /doc subpage looks like when viewed directly. It only does this for certain ones. Rocket000 (talk) 22:35, 8 August 2009 (UTC)

It's something to do with including the documentation in Template:Meta information museum/layout. I have no idea what's going on there. Rocket000 (talk) 22:41, 8 August 2009 (UTC)
A template page is supposed to show largely what the doc page shows. Perhaps you are referring to pages where the parameters have not been filled in?--Patrick (talk) 10:15, 20 September 2010 (UTC)


Maybe related to other problems (I'm not actually sure what bug#2 above is). Using the field "|example= " to show an example doesn't work (see {{Original caption}}. It just echos the call to the template so we see

{{Original caption|Jimmy Wales in December 2008|Wikipedia}}: {{Original caption|Jimmy Wales in December 2008|Wikipedia}}

instead of

{{Original caption|Jimmy Wales in December 2008|Wikipedia}}: Original caption:  “Jimmy Wales in December 2008” — Wikipedia

The problem seems to be caused by copious <nowiki/> tags, I'm not even sure what <nowiki/> is meant to do, as opposed to <nowiki>...< /nowiki> constructs. --Tony Wills (talk) 11:27, 9 August 2009 (UTC)

It now produces
{{Original caption|Jimmy Wales in December 2008|Wikipedia}}: Original caption: “Jimmy Wales in December 2008|Wikipedia”
which is slightly different from what Tony Wills reported, but still unexpected. The TemplateBox code did not change since. I added a work around to {{Original caption}}'s documentation at Template:Original caption/doc to make the syntax and examples more legible and hopefully more accurate. I also added Issue 4 below (might not be a bug). -84user (talk) 18:52, 25 January 2010 (UTC)
When I created the template, based on the fact that you can insert | into tables, I thought that it's possible to insert | as parameter separators. But apparently the parsing order is different. It does not work this way. One parameter works fine, but more than one is just impossible with the current design. I'll have to think about a way to implement this in another way. --Slomox (talk) 20:45, 25 January 2010 (UTC)
I added "works with a single unnamed parameter only". Something like Template:Xpdoc could be built in, but it seems more practical to put the examples below the template.--Patrick (talk) 18:30, 20 September 2010 (UTC)

Issue #4[edit]

Yes check.svg ResolvedOne parameter examples now render well. --84user (talk) 05:35, 26 January 2010 (UTC)

Maybe related to bug #3 above. I used the field "|example=" to show a simple example with no pipe characters, and although it expands as expected (unlike Bug #3 above), its location in the Usage section was confusing, running directly after the "|relieson=" field. See Template:Category tree both (this revision) for my attempt at getting it to display something understandable. I gave up, commented out the example parameter and relied on my hand-coded example in the field "|usage-notes=". I needed to add html break tags ("<br /><br />") after the "relieson" value to avoid remaining confusing layout. -84user (talk) 18:52, 25 January 2010 (UTC)

I changed the template, so examples go into a separate section now. --Slomox (talk) 20:20, 25 January 2010 (UTC)

Yes, thank you, that is fast work and resolves the issue with one parameter examples. It means that examples with one parameter can be handled in the "example=" field. Accordingly I have removed the now-duplicated example from Template:Category tree both/doc. -84user (talk) 05:35, 26 January 2010 (UTC)

this part of the documentation is only available in some languages[edit]

Is it ok if I remove this part? I still don't see the point. Rocket000 (talk) 05:00, 28 February 2010 (UTC)

It informs you that - while the whole rest of the page is automatically localized - these paragraphs need per-language localization. --Slomox (talk) 13:28, 28 February 2010 (UTC)
Oh, yeah, I guess it would make more sense if I saw more doc pages that started mixing languages. Maybe we could hide it for English interface users? Rocket000 (talk) 20:06, 28 February 2010 (UTC)
To what extent a field is localized can vary, regardless of the method used, such as subtemplates /xx, or Template:LangSwitch, so I do not see the purpose of the message.--Patrick (talk) 10:58, 20 September 2010 (UTC)
It's seems that every single documentation template on Commons begins with this message. It's usefulness to spamminess ratio is about 1:10 in my opinion, especially since most our documentation templates are already mostly unreadable. I think it should be removed. Kaldari (talk) 22:24, 6 May 2011 (UTC)
I went ahead and removed it from the English version for now. Kaldari (talk) 22:30, 6 May 2011 (UTC)

I'm very confused what it means. For example the parameter "seealso". That part must be appear in ALL language (links...)!?? Must I do give for every language a extra "see also" link??? Or mean it simply the lack of {{int:Seealso}}?? -- Perhelion (talk) 15:49, 4 April 2014 (UTC)


Yes check.svg Resolved

Hello, I used this template for template {{RKD}}, but after I added the parameter for example, two examples showed up. A ‘normal’ example and something called ‘example2’. How can this be fixed? Regards, Vincent Steenberg (talk) 16:13, 2 June 2010 (UTC)

Fixed it. Probably a bad copy&paste. Jean-Fred (talk) 19:20, 2 June 2010 (UTC)

3stat in Template:Category maintenance/doc[edit]

In the above description, field "3stat" doesn't seem to display its value. It's present in Template:TemplateBox. -- User:Docu at 06:26, 17 June 2010 (UTC)

There might be bug in Template:TemplateBox/layout though. -- User:Docu at 06:28, 17 June 2010 (UTC)
It's not a bug. It's just that the 'stat' params are restricted to a fixed set of values ('optional', 'optional-', 'required', 'deprecated'). If the parameter is optional in some circumstances and required in others you should set 'optional' and describe the different circumstances in the description ('d' params). --Slomox (talk) 11:31, 17 June 2010 (UTC)
I see. Shouldn't we add "Conditional"? -- User:Docu at 14:42, 17 June 2010 (UTC)

More examples, and in a table for one-line templates[edit]

  • First we need to be able to provide more examples than just 2. Is it possible to add more parameters in the layout, for passing the parameters for each example ?
  • Second : instead of displaying multiple sections, one for each example, it should be possible to present them in a 2-column table (the first one for the generated code, the second one for how it renders), notably for templates that generate little code or just a line of text, where it does not really matter how it will fill the width. There's already a parameter controlling that, it is lines=one : If it is present, then a table presentation will be enough, but you could imagine as well a parameter like examples-table=yes which would generate the single section containing the table, and not several sections.
    • Alternatively, we should be able to provide the full content of examples, within a parameter named examples= containing the full section to place in an "Examples" section.

verdy_p (talk) 01:26, 17 July 2010 (UTC)

Though I agree that examples are nice, we do not have to rely on {{TemplateBox}} to provide them. See for example {{Mérimée}}, where TemplateBox is used and examples are provided after in plain wikitext. Jean-Fred (talk) 12:34, 17 July 2010 (UTC)

Extra space in example and horizontal browsing[edit]

Two issues:

  1. If you look at the rendered example on Template:Template deletion request there's an extra space inserted at the beginning of the first parameter. This can be observed by looking at the link it creates: Commons:Deletion requests/ Template:Template deletion request.
  2. The pink box surrounding the example expands past the screen. Also, it probably shouldn't be pink as that can be interpreted as part of the template. Maybe a use a border like {{msgx}} does?

Rocket000 (talk) 00:28, 31 July 2010 (UTC)

I fixed the problem with the space.
I also reduced the width of the example so no overflow should occur anymore and I changed the color to pure white (although the previous #fff5ff is so close to white that it's indistinguishable from white on my screen). --Slomox (talk) 11:40, 31 July 2010 (UTC)
Thank you! Rocket000 (talk) 11:44, 31 July 2010 (UTC)

Bug: parameter table[edit]

Strangly Template:Painting/doc looks just fine while its copy on Template:Painting have some extra text between Parameters header and the table. The text came from gallery description. Can some one fix the template to correct that? --Jarekt (talk) 21:20, 19 August 2010 (UTC)

This seems an outdated remark, the pages are redirects now.--Patrick (talk) 11:01, 20 September 2010 (UTC)
I agree it seems fine now --Jarekt (talk) 00:41, 21 September 2010 (UTC)

Duplication of numbers of unnamed parameters[edit]

There is a useless duplication of the numbers of the unnamed parameters 1-20: by definition the first has implicit name 1, the second 2, etc. In fact, also the parameter {{{msg-parameter-no}}} does not seem needed, but that does not matter, it can be decided for each language whether it is left blank. However, the texts 1 (1), 2 (2), etc. are fixed in the protected Template:TemplateBox/layout. I think it is best to change them to "(1)", "(2)", etc. (the parentheses indicate that the names are not needed explicitly).--Patrick (talk) 06:20, 22 September 2010 (UTC)

I don’t understand your request. Could you rephrase and state clearly how do you want the template to be changed?
(And note that numbered parameters are sometimes necessary, especially when the value contains an equal sign.)
--Mormegil (talk) 11:01, 27 November 2010 (UTC)
My proposal is to delete from Template:TemplateBox/layout: ''{{{msg-parameter-no|}}}1'', ''{{{msg-parameter-no|}}}2'', .. , ''{{{msg-parameter-no|}}}20'', as the numbers are just a duplication of the numbers right after them, while the text ''{{{msg-parameter-no|}}}'' is not needed either.--Patrick (talk) 08:24, 5 December 2010 (UTC)
But why? {{{msg-parameter-no}}} is a message indicating the parameter is numbered, not named, and used in localizations to form “parameter #3” etc. (and there is no way template parameters could themselves be parameterized to form something like {{{msg-parameter-no|3}}} → “parameter #3”). The parentheses after it seem a bit redundant/misleading, but I don’t know what could be done to improve that; maybe add an equal sign, e.g. “parameter #3 (3=)”? --Mormegil (talk) 21:40, 12 December 2010 (UTC)
"3" is the name of the parameter. For a parameter with such a name the name does not have to be explicitly given in the template call. This is general template knowledge. If the text (especially the "#") is supposed to remind the reader of this, this is not clear at all.--Patrick (talk) 07:28, 20 December 2010 (UTC)

Remove the category[edit]

{{Edit request}}

Please remove the category

[[Category:Template documentation|{{PAGENAME}}]]

from the template. I have added this category to the documentation subpage Template:TemplateBox/doc. Thanks in advance --Labant (talk) 20:50, 3 December 2010 (UTC)

✓ Done --Jarekt (talk) 16:15, 4 December 2010 (UTC)

Add parameters[edit]

{{edit request}}

Please add:

Template:Book/doc uses this template and has 22+ parameters. thanks. --User:Doug(talk contribs) 12:24, 31 December 2010 (UTC) ✓ Done --Jarekt (talk) 16:56, 15 January 2011 (UTC)

namespace parameter will only accept a single value[edit]

See my edit [1], the namespace parameter appears to only accept a single value. Multiple values cause it to display "unknown". We should either fix this in the template or specify this in the documentation.--User:Doug(talk contribs) 09:20, 17 January 2011 (UTC)

I think that is because other values or combination of valid values are not translated. I added a sentence to the documentation. --Jarekt (talk) 03:56, 18 January 2011 (UTC)
I also stumbled over this missing feature, and figuring it out with three plausible candidates (comma separated list, space separated list, multiple namespace parameters) is clumsy.
Background, I found that Template:ValidSVG works in the File_talk namespace, i.e., not only in the documented File namespace. Therefore I wanted to add this minor but relevant detail, and ended up here. Apparently more than one namespace is a hard problem, but there are some preconfigured combos, e.g., all and talks. How about adding File+talk and some similar cases? Template+talk and User+talk could be also relevant here. –Be..anyone (talk) 18:18, 22 December 2013 (UTC)
I guess that wouldn't be hard with Lua anymore. It just needs someone to code that. As for validSVG, there is a difference between works and is intended for. -- Rillke(q?) 20:43, 22 December 2013 (UTC)
+1 Symbol support vote.svg Support needed. User: Perhelion (Commons: = crap?)  12:13, 3 February 2015 (UTC)

Misspelling in placement=top (ru)[edit]

"В верхней части страницы страницы" (en: At the top of the page page) is incorrect. It should be "В верхней части страницы" (en: At the top of the page). SWFlash (talk) 15:39, 6 March 2011 (UTC)

Seems to be fixed now? --Jarekt (talk) 02:29, 8 May 2011 (UTC)

usage-notes parameter seems to be broken[edit]

The usage-notes parameter seems to be broken, but I can't figure out why. Kaldari (talk) 22:40, 6 May 2011 (UTC)

I tried it here and it seems to work fine. --Jarekt (talk) 02:27, 8 May 2011 (UTC)


I think we could have an additional bit of code which would (in a separate subsection?) display something like

This template can be accessed via the redirect bla

where bla would be a name taken from a subpage of the template (of the style PAGENAME/name-xx, where xx is the relevant language code), wrapped in an #ifexist so it only shows translated redirects that have been created and appropriately listed. The idea is to make it easier to use templates by providing native-name redirects, so that people don't have to remember the English name of a localised template. I've created {{Redirect from translated template name}} to support this, but it would make a lot of sense to provide an easy way to show the translated template names in the relevant documentation, and this sprang to mind. Any thoughts? Rd232 (talk) 13:29, 16 June 2011 (UTC)

PS to give a concrete example: {{Hecho}} would be listed at Template:Done/name-es. Rd232 (talk) 13:31, 16 June 2011 (UTC)
In general I think this is a good idea, but I wonder how many such templates do we have? Is it worth it? I would propose to list {{Hecho}} at Template:Done/localized redirect/es. --Jarekt (talk) 14:47, 16 June 2011 (UTC)
I'm not sure how many exist at present; since I've only just created the specific tagging template, there may be many hidden in categories they shouldn't be in, or without any categories. And I think for some templates which are commonly used by users (like polling templates) it's worth encouraging the creation of new localized redirects. I agree your name structure's probably better. I'm slightly wondering though if the subpage approach is the best way to go; maybe it can be done just as easily by storing the redirect data inside the template documentation (some form of {{LangSwitch}}?), and that would also allow for the odd case of multiple redirects in a given language. Rd232 (talk) 14:58, 16 June 2011 (UTC)
I think {{LangSwitch}} in "shorthand" field would be the cleanest and would not require changes to this template. --Jarekt (talk) 17:48, 16 June 2011 (UTC)
I don't think it'll work very well in the current "shorthand" field, which expects to get only one parameter. Maybe that can be amended, but it might tricky not to break the status quo. What would be really cool, actually, would be to display the appropriate localised redirect or English shorthand (if it exists) as a shortcut in the top right of the documentation (in the style of {{Shortcut}}). Rd232 (talk) 18:55, 16 June 2011 (UTC)

missing fallback for translations[edit]

Before I added |msg-placement-source= to a German translation nothing at all was displayed at a doc page which used "source" in "placement". It should have simply shown then English translation instead. Cheers --Saibo (Δ) 21:00, 1 October 2011 (UTC)

Maybe this is a general issue of {{Autotranslate}}? --Saibo (Δ) 21:07, 1 October 2011 (UTC)

One has to use the fallback at the layout-template. e.g. {{{msg-placement-source|English fallback text here}}} but the template doesn't do this. It only does {{{msg-placement-source|}}} -- Rillke(q?) 19:08, 21 June 2013 (UTC)

|msg-placement-source=: "or just below this template"?![edit]

I suggest to remove "or just below this template" at |msg-placement-source= in Template:TemplateBox/i18n/en and Template:TemplateBox/i18n/fr (and other if present). Doesn't make sense if it should be placed in "source". Cheers --Saibo (Δ) 21:06, 1 October 2011 (UTC)

subst parameter[edit]

I think an parameter called "subst" should be added to indicate that the template must be substed AzaToth 22:04, 7 November 2011 (UTC)

Um, no, the template should not be subst:ed. This is what the source code looks like when you do it. Rd232 (talk) 23:26, 7 November 2011 (UTC)
I didn't mean that the template should be substed, but a parameter indicating that the template this templatebox is used for should be substed. Sorry for not being clear :) AzaToth 23:44, 7 November 2011 (UTC)
Oh, OK, a parameter to transclude {{Must be substituted}}? I'm not sure it's worth it. Rd232 (talk) 02:23, 8 November 2011 (UTC)

use mustbesubst -- Rillke(q?) 18:25, 21 June 2013 (UTC)

Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Rillke(q?) 18:25, 21 June 2013 (UTC)

Addition 2[edit]

I propose to add to the parameter "usergroup" the following values:

  • file mover
  • rollbacker
  • patroller
  • autopatroller

Greetings. Angelus (talk) 02:57, 11 November 2011 (UTC)

Now, nearly all user groups are included. -- Rillke(q?) 18:26, 21 June 2013 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Rillke(q?) 18:26, 21 June 2013 (UTC)

Automatic preload[edit]

I modified Template:Editnotices/Namespace/Template to show information on each template doc subpage about this template. Also in case of creation of new template doc subpage there will be an option to preload the template from Template:TemplateBox/preload. Try for example [2]. I hope that this will simplify template documentation. Let me know if any tweeks need to be done to the system. --Jarekt (talk) 14:07, 14 December 2011 (UTC)

Looks fine, thank you! -- Rillke(q?) 18:27, 21 June 2013 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Rillke(q?) 18:27, 21 June 2013 (UTC)


I've added a new parameter, |mustbesubst. If set this adds subst: into the "usage" example. Rd232 (talk) 23:16, 5 April 2012 (UTC)

Why didn't you also add #subst parameter? Did this now. -- Rillke(q?) 18:40, 21 June 2013 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Rillke(q?) 18:40, 21 June 2013 (UTC)

Not enough for {{Ship}}[edit]

{{Ship}} has over about 32 parameters, so this template’s 30 is not enough. --AVRS (talk) 17:20, 9 April 2012 (UTC)

what the... {{Ship}} seems like a Wikipedia infobox template, not a Commons template. Rd232 (talk) 19:03, 9 April 2012 (UTC)
Please store large quantities of structured data at Wikidata. Thank you. -- Rillke(q?) 18:42, 21 June 2013 (UTC)
Now the template supports as many parameters as Lua will be able to deal with. -- Rillke(q?) 18:27, 17 August 2013 (UTC)

Category:Template documentation pages[edit]

Why are most /docs suddenly being categorised into Category:Template documentation pages (which doesn't exist) instead of Category:Template documentation (as before, which does)? I feel TemplateBox must be the reason, but I can't see how, never mind why. Rd232 (talk) 22:45, 26 July 2012 (UTC)

I guess this was responsible for the unexpected results // Template talk:Documentation#Import for en.wikipedia -- Rillke(q?) 00:07, 27 July 2012 (UTC)
Maybe, but I couldn't find any categorisation there either... Did you fix something? All the /docs are suddenly back in the old category again! Rd232 (talk) 00:17, 27 July 2012 (UTC)
Template:Documentation subpage. There was a switch in it so it was hard to find. -- Rillke(q?) 00:26, 27 July 2012 (UTC)
Well it helps if you're looking at the right template! :) Rd232 (talk) 02:22, 27 July 2012 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Rillke(q?) 18:43, 21 June 2013 (UTC)

example (3)[edit]

{{edit request}} I suppose to add a parameter example-value, for an alternative result for the example:

== {{{msg-example|}}} ==

<nowiki>{{</nowiki>{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}{{!}}{{{example}}}<nowiki>}}</nowiki>

<div style="border: 1px solid black; background-color: #ffffff; width: 90%; padding: 1.5em;">
{{{example-value|{{{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}|{{{example|}}}|category=}}}}}
}}{{#if: {{{example2|}}} |<nowiki/>

So it would be possible to use examples with more than one parameter by setting example=Param1{{!}}Param2{{!}}Param3 and example-value={{Exampletemplate|Param1|Param2|Param3}}. Even named parameters would be possible (example=Whatever=value | example-value={{Exampletemplate|Whatever=value}}). -- F-scn (talk) 12:56, 25 November 2012 (UTC)

This requires editing all language subpages to forward the new parameter to the layout template, correct? -- Rillke(q?) 14:14, 27 May 2013 (UTC)
Now it's a lot easier editing all subpages. One click, and FuzzyBot the changes every language subpage. Demo at Special:Permalink/98614170. -- Rillke(q?) 18:24, 21 June 2013 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Rillke(q?) 18:59, 21 June 2013 (UTC)

Documentation page categorized because of included example[edit]

Hi all, it seems I don't get something here: I just used {{TemplateBox}} for Template:Trimming/doc. The problem is that the documentation page is now categorized into Category:Images requiring trimming probably because of the example I included. As a result also the template {{trimming}} itself is categorized into the same category. Am I doing something fundamentally wrong? -- Patrick87 (talk) 21:36, 6 April 2013 (UTC)

✓ Done. Yes, the inclusion of the example is triggering the autocategorisation. The solution is to prevent the autocategorisation based on the Namespace − I did that using {{iffile}}: the autocat is only applied when the template is used in the File: namespace. Jean-Fred (talk) 21:45, 6 April 2013 (UTC)
Thanks! Just one little follow-up question (since I'm alway curious to learn something new): Is this the default solution for such a problem or is there an alternative/better way to include a category that maybe prevents the problem from the start making such a workaround unnecessary? -- Patrick87 (talk) 23:02, 6 April 2013 (UTC)
You’re welcome. Yes, as far as I know, this has always been how it is done − I do not think there is any other way. <noincluide> and <includeonly> tags can only control whether the category is used on transclusions, on the page itself or both. It just happens that templates which autocategorize are used elsewhere (as category headers, to be discussed in talk pages, etc.), so filtering based on the namespace makes sense. Jean-Fred (talk) 23:38, 6 April 2013 (UTC)
Another common approach is wrapping the category in {{{category|…}}}. -- Rillke(q?) 18:00, 21 June 2013 (UTC)

new parameters[edit]

{{edit request}} Jarekt added new parameters (param. 31, 31d, … and 32, 32d, …) to the main template and English subtemplate. Please add it to the other language templates and (only 32) layout template. tacsipacsi (talk) 16:01, 7 June 2013 (UTC)

(edit conflict) I added all of them just before your request. But you could have done most of them, as most language subtemplates are not protected. --Jarekt (talk) 16:35, 7 June 2013 (UTC)

When someone does so, they can also do #example (3). -- Rillke(q?) 16:17, 7 June 2013 (UTC)

The default value for "name" should be {{BASEPAGENAME}}
And how about an additional parameter setsclass ? sarang사랑 06:45, 14 June 2013 (UTC)
What should this additional parameter exactly do? -- Rillke(q?) 17:46, 21 June 2013 (UTC)
Some templates set a CSS class. Like categories set by a template can be documented with setscats=, it might be useful to specify in a similar way the class if set by a template. sarang사랑 16:16, 28 June 2013 (UTC)
While I agree that this sounds useful, it would be also useful to document if a template sets an ID. The issue I see here is that we document details that technical-experienced users can extract their own very speedily and non-techs will not even understand why we documented them. Also, compared to categories, which are really set, there can be multiple containers/nodes in the template with different classes or even just a style and a class attribute that is reused by another template. Is it worth to document all of them? Don't we run in danger to run out of sync with the content when templates are updated? If, at all, I would label this parameter containerclass… or something better. And it should be documented for which reason this class attribute was set. A few (specific) use cases would be helpful. -- Rillke(q?) 16:57, 28 June 2013 (UTC)
After this discussion, I don't think anymore that classes should be documented as I had the idea. Compared to categories which are much more essential and noteworth, information about class[es], if thought necessary, are better to be mentioned otherwise, e.g. by usage-notes or something else. Thank you, sarang사랑 04:42, 29 June 2013 (UTC)

TemplateBox should expose TemplateData[edit]

to avoid adding redundant information and it should ensure that valid JSON is exposed. -- Rillke(q?) 20:44, 16 June 2013 (UTC)

I will start working on this very soon. Thanks to Ricordisamoa, we have Module:JSON and with LUA, the layout template will shrink a lot. It is great that we have such a structured template here at Commons. Kudos to those who set it up und who used it. -- Rillke(q?) 10:48, 9 July 2013 (UTC)

Great --Jarekt (talk) 13:49, 9 July 2013 (UTC)

Work in progress[edit]

I am currently migrating this template so it can take one of the benefits of the translate-Extension: With just one click, you can order FuzzyBot to change all language templates. This will ease further development of this template as the hassle of having to change all language templates individually will be resolved. -- Rillke(q?) 22:28, 19 June 2013 (UTC)

Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Rillke(q?) 16:58, 28 June 2013 (UTC)

Fix [edit] link[edit]

After the changes in MediaWiki regarding section editing links, and update for this template is needed, too. Currently the [edit] link is shown above the "Documentation" heading of the TemplateBox.

The edit link has to be placed in a span next to (right of) the heading, and the class name of this span has to be changed from the old editsection to the new mw-editsection. --Patrick87 (talk) 22:59, 21 June 2013 (UTC)

✓ Done at Template:Documentation/layout. -- Rillke(q?) 23:52, 21 June 2013 (UTC)
Sorry, not completely resolved yet: Right now we have the [edit] button (which is fixed now and works as intended) but we have additionaly the (edit | history | purge) buttons. They should probably be incorporated into the span of the [edit] button (and one of the surplus edit buttons has to be deleted). Anyway, thanks for the really fast reaction! --Patrick87 (talk) 00:08, 22 June 2013 (UTC)
This is like how it was implemented before: Special:Permalink/63871702. The [2] is also an edit link. I look how one can improve it today or you just do it (it's not protected). -- Rillke(q?) 08:02, 22 June 2013 (UTC)
Sorry, it's still protected (beacause of cascading protections), so I can't fix it myself. I'd propose something like this:
<div class="template-documentation" style="margin-top:1em; clear: both; border: 2px dotted #666666; padding: 0.6em; background-color: #ECFCF4;">{{#ifeq:{{{heading|}}} | false | | <div style="padding-bottom:3px; border-bottom:1px solid #aaa; margin-bottom:1ex;"><span style="font-size:150%">{{#if: {{{heading|}}} | {{{heading}}} |[[File:Template-info.png|50px|link=|alt=Documentation icon]] {{{documentation|Documentation}}} }}</span><span class="mw-editsection plainlinks" id="doc_editlinks">{{int:editsection-brackets|[{{fullurl:{{#if: {{{1|}}} | {{{1}}} | {{SUBJECTPAGENAME}}/doc }}}} {{{view|{{int:vector-view-view}}}}}]}} {{int:editsection-brackets|[{{fullurl:{{#if: {{{1|}}} | {{{1}}} | {{SUBJECTPAGENAME}}/doc }}|action=edit{{#ifexist: {{#if: {{{1|}}} | {{{1}}} | {{SUBJECTSPACE}}:{{SUBJECTPAGENAME}}/doc }} ||&preload=Template:Documentation/preload}}}} {{{edit|{{int:vector-view-edit}}}}}]}} {{int:editsection-brackets|[{{fullurl:{{#if: {{{1|}}} | {{{1}}} | {{SUBJECTPAGENAME}}/doc }}|action=history}} {{{history|{{int:vector-view-history}}}}}]}} {{int:editsection-brackets|[{{fullurl:{{#if: {{{1|}}} | {{{1}}} | {{SUBJECTPAGENAME}}/doc }}|action=purge}} {{{purge|{{int:Code-rev-purge-link}}}}}]}}</span></div>}}
''<small>{{{text|text parameter not translated in [[Template:Documentation]]}}}</small>''
{{#if: {{{1|}}} |{{{{{1}}}}}|{{{{SUBJECTPAGENAME}}/doc}}}}<div style="clear:both;" /></div>{{#ifeq:{{SUBPAGENAME}}|sandbox|[[Category:Sandbox templates]]}}
It's a little heavier than before but better fits default editsection links. Additionally this style would match the Englisch en:Template:Documentation.
Two question you can maybe help me with:
  • The span with the links included the class "dablink" as well as the id "template_doc_page_transcluded". Are they still needed? There were at least no styles applied to the class and I don't know if the id is used somewhere.
  • I tried to unify the translations. Do you know why I can't use <Purge> although translatewiki:MediaWiki:Purge/en seems to be available?
--Patrick87 (talk) 13:44, 22 June 2013 (UTC)
1) The proposal is identically to the current state Did you copy the wrong text? 2) Don't know; requires history digging and poking users 3) don't know, something to ask Raymond or Siebrand. -- Rillke(q?) 20:00, 22 June 2013 (UTC)
1) Oh damn, actually I copied the wrong code. I updated it above. 2) It was there from the start but it seems to be a leftover that was imported from English Wikipedia (there was a Template:Dablink once, which has been deleted). I searched Commons for the strings and I think it's not needed anymore. Let's remove it and just see if somebody complains (I don't think so). 3) OK, thanks. I'll see what I can do, never actively used translatewiki before, so I still have to learn about everything a bit. --Patrick87 (talk) 20:29, 22 June 2013 (UTC)
Thank you. Template code updated. -- Rillke(q?) 23:19, 24 June 2013 (UTC)

Surplus line break below "See also" heading[edit]

When specifying related templates with the seealso parameter, an unnecessary line break is put after the heading and before the links. --Patrick87 (talk) 01:03, 23 June 2013 (UTC)

✓ Done. My fault. -- Rillke(q?) 23:06, 24 June 2013 (UTC)
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. Rillke(q?) 23:06, 24 June 2013 (UTC)

Shorthand or redirects[edit]

How do I add more than one shorthand or redirect? See Template:Cat see also/doc and Template talk:Cat see also/doc.

These all redirect to Template:Cat see also. --Timeshifter (talk) 06:14, 1 July 2013 (UTC)

I figured out how to add more than one shorthand redirect to Template:TemplateBox. See example templates, and their documentation pages that use {{TemplateBox}}:
Template:Cat see also
Template:Cat see also/doc
--Timeshifter (talk) 07:19, 26 July 2014 (UTC)

Dropping "This part of the template is only available in some languages"[edit]

Do we need that message telling the obvious? Or is there something behind it? -- Rillke(q?) 18:05, 17 August 2013 (UTC)

Minor improvements[edit]

Thanks for all the great work done on this template. Several issues I had with the old template were fixed. As I am looking at the new format of this template, I was noticing many things that could be improved. Some of them are new and some are leftovers from the old template. All should be treated as suggestions open for discussion, if controversial.

  • In Parameter table aliases should be listed one per line, otherwise it looks like you have parameter names with commas.
    • ✓ Done -- Rillke(q?) 13:58, 22 August 2013 (UTC)
  • Parameter table have an empty column on the left. It looks like it is for the new "1label" and "1set" parameters. May be it should disappear if they are not used, which is in most cases at the moment. Also I think the Parameter code and aliases column should be first and the short label should be column one of the description.
    • ✓ Done -- Rillke(q?) 13:58, 22 August 2013 (UTC)
  • Localization section for mediawiki-msg case says "This template is localized by utilizing MediaWiki namespace messages. These can be translated at translatewiki.net (current translations)." with "current translations" usually having a dead link to nonexisting page. See {{Artwork}} or {{Information}}. May be we can overwrite this default location somehow.
  • i18n-method often used is {{LangSwitch}} block in some other i18n template like subtemplates of {{I18n}} or sub templates like {{Artwork/i18n}}. Some of those could and should be moved to translatewiki, but at the moment are kept here.
  • I always have problems filling Enumerated type parameters like namespace, usergroup or i18n-method, since many templates do not fall into any of the single categories. For example {{Creator}} template is is intended to be used in "File" and "Category" namespace or {{Artwork}} is localized using translatewiki and {{Artwork/i18n}} subtemplates. May be we can allow lists of enums.
  • Usage section provides block of code which can be cut and copied as a whole but not in pieces. I often like to copy parts of the template to add to existing pages. Can we go back to allowing that?
    • A "copy button" would be handy. Also the current "feature" is somewhat fancy as not supported by most browsers, except FF. Let me think a bit about this. -- Rillke(q?) 13:58, 22 August 2013 (UTC)
    • ✓ removed select-all-with-one-click as it is counter-intuitive and not well-supported. -- Rillke(q?) 16:09, 5 December 2013 (UTC)
  • Usage section can be either in one-line or multi-line format. Can we add an option of multi-line with aligned "=" signs? That is often preferred formatting for infobox templates.
    • ✓ Done. print=infobox or simply type=infobox omitting print and lines. -- Rillke(q?) 13:58, 22 August 2013 (UTC)
  • Empty "1", "1d", "1d-en", "1def", "1stat", etc. should be treated the same as if they were not provided at all. For example Template:Documentation/preload is in Category:LangSwitch template without default version maintenance category because of empty "1d-en".

--Jarekt (talk) 13:03, 19 August 2013 (UTC)

I agree that users should be able to copy a portion of the "usage" code. It's very annoying to only be able to copy the whole thing. And if only FF users are getting this "helpful feature", I say disable it so everyone can highlight and copy the text they want in the usual way. - dcljr (talk) 10:33, 5 December 2013 (UTC)

How to get TemplateBox to properly generate a “Template data” section?[edit]

parameter order[edit]

Parameter order in Template:Artwork/doc seems to have little correlation with "1", "2" order. For example "accession number" is suppose to be between "notes" and "source". --Jarekt (talk) 17:52, 18 November 2013 (UTC)


Hi! New automatic categories have been made, but we already have similar ones:

Can they be merged? --tacsipacsi (talk) 18:24, 17 March 2014 (UTC)

We've implemented that this way because the categorization will be according to how the approach is documented, allowing to use, for example category intersections to spot errors in documentation. Category:Commons templates by documented internationalization approach is a maintenance category. -- Rillke(q?) 19:19, 17 March 2014 (UTC)

Suggestion for copy code[edit]

How about display automatically the source code (en) to copy (as it is often used before Autotranslate) for the new language subpage (for example Template:Apache/en)!?

|text=Copyright © {{#if:{{{2|}}}|{{{2}}}|{{#expr:{{CURRENTYEAR}}}}}} {{#if:{{{1|}}}|{{{1}}}|The author}}

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
{{translated tag|license}}

And then mention that

- |lang=en
+ |lang={{subst:SUBPAGENAME}}

is to replace. -- Perhelion 21:41, 26 May 2014 (UTC)

Oh I see now the source code is automatically in the new subpage (so it's almost not needed). I've never done this. :-P But is it not possible to replace the static "en" to {{subst:SUBPAGENAME}}? -- Perhelion 21:54, 26 May 2014 (UTC)

If you tell me how, I'll do it. Apart from that, please create new templates using the translate extension for translation. -- Rillke(q?) 22:30, 26 May 2014 (UTC)

Explicit translatewiki.net link[edit]

{{editprotected}} Please replace:

These can be translated at <tvar|translatewikilink>[[:translatewiki:MediaWiki:{{#if:{{{i18n-mediawiki-msg|}}}|{{{i18n-mediawiki-msg|}}}|Wm-license-{{lc:{{BASEPAGENAME}}}}-text}}|translatewiki.net]]</>


These can be [[<tvar|twn-wm></>|translated at translatewiki.net]]

--Nemo 18:13, 3 July 2014 (UTC)

@Nemo bis: This will make the i18n-mediawiki-msg parameter superfluous. Is it intentionally dropped? -- Rillke(q?) 18:29, 3 July 2014 (UTC)
Yes and no, I'm not aware of substantial use of messages by templates on Commons other than those in the WikimediaMessages extension and linking MediaWiki namespace pages doesn't work very well anyway. However if you're not sure I'm too lazy to check hundreds templates and we can keep it, like
These can be [[<tvar|twn-wm>translatewiki:{{#if:{{{i18n-mediawiki-msg|}}}|MediaWiki:{{{i18n-mediawiki-msg|}}}|Special:Translate/ext-wikimediamessages}}|translated at translatewiki.net]]
--Nemo 17:27, 5 July 2014 (UTC)
So'll be it. Thank you. -- Rillke(q?) 19:19, 5 July 2014 (UTC)

Category:Pages using duplicate arguments in template calls[edit]

Rillke There is a problem with {{TemplateBox}} using "Example" variable as it shows up in Category:Pages using duplicate arguments in template calls for example {{TemplateBox|name=CopyvioOTRS|example=0000}} is enough to be added to that category. Is there a way to fix it? --Jarekt (talk) 13:01, 13 November 2014 (UTC)

Needs debugging. First we have to find out which template is called with duplicate arguments. -- Rillke(q?) 19:16, 13 November 2014 (UTC)
FWIW, Tdoc on Meta (a vintage 2010 {{TemplateBox}} simplified by Patrick) also puts lots of templates in this new tracking category. –Be..anyone (talk) 18:40, 26 December 2014 (UTC)


Hi, a second example won't show up whenever I try to use the example2 parameter here. What am I doing wrong? // WikiPhoenix [Talk] 00:33, 9 December 2014 (UTC)

Artefacts in template data[edit]

The template data shown for "status" contains three unescaped &nbsp;. Similar "translation method" contains three unescaped &#123;&#123;[[link]]&#125;&#125; constructs, apparently some escaped {{tl|autotranslate}} links. mw:Help:TemplateData mumbles something about "no wiki markup in JSON, svp", maybe these are copy and paste issues. There are more (similar) issues in the template data. –Be..anyone (talk) 18:25, 26 December 2014 (UTC)

i18n-method = module[edit]

Some of the internationalization pages are slowly moving from {{LangSwitch}} blocks in templates to tables in Lua, see [3]. We should probably have an i18n-method option that matches that. --Jarekt (talk) 20:50, 27 January 2015 (UTC)

Symbol support vote.svg Support, needed. --Zolo (talk) 08:16, 29 January 2015 (UTC)

"Or use the shorthand"[edit]

It is what shows up in the shorthand spot. Could this be changed to:

  • Shorthand and redirects

People are deleting some info about redirects because some redirects are not always shorter names (shorthand). People create all kinds of redirects, both longer and shorter than the original template name. Anything that helps people remember and use the templates is a good thing. We all remember different things, different spellings (British, American, etc.), different phrasing, etc.. --Timeshifter (talk) 00:22, 5 February 2015 (UTC)

Symbol oppose vote.svg Oppose based on my comment on your talk page. I have no problem at all with, say, {{igen}} as desirable shorthand for {{image generation}}, 4 vs. 16 characters. Not the same as {{CatCat}}, where a "see also" redirects is good enough to cover its "longhand" redirects. –Be..anyone (talk) 05:50, 5 February 2015 (UTC)
There is nothing to oppose. As I said, you obviously are clueless as to how many people actually use redirects concerning templates. They, like shorthand, are used for convenience and memory. The number of characters is not necessarily what makes a redirect convenient. It is the fact that one easily remembers certain redirects. This is the traditional reason many people use these template redirects on the Commons. I have created many template redirects, and many template shorthands. "Shorthand" in TemplateBox is just a one-word entry in the form. With one-word entries one must choose one word. Traditionally we have listed both redirects and shorthand in the documentation. TemplateBox is a more recent creation. Thus we need to align it with tradition by using my suggestion or something similar. Separating shorthand and longhand redirects in different parts of the documentation is just stupid. Spelling and punctuation variations are common reasons for template redirects. --Timeshifter (talk) 02:01, 6 February 2015 (UTC)
If you almost always want a "redirects" link (WhatLinksHere hiding links and transclusions) {{TemplateBox}} could almost always generate it and put it into its "see also" section or similar. The shorthand position is at the top of the documentation, it's for advertizing, same idea as {{shortcut2}}. But learning that {{MetaCat}} has an alias without camel-case, plus a link to check that this in fact the only redirect to MetaCat is a distraction from what's relevant, the syntax and parameters of {{MetaCat}}.
For {{CatCat}} it is similar, but it actually has some (longer) aliases, which might be interesting for users who don't want to click WhatLinksHere + hide links + hide transclusions. The construction of one link for this business is fun, but at the end of the day, how often do you plan to check all redirects to {{CatCat}}, and why must that be at the top of the documentation? –Be..anyone (talk) 02:30, 6 February 2015 (UTC)
{{shortcut2}} is not the same as the shorthand and redirects for templates. Most {{shortcut2}} shortcuts I see consist of the first letter of each word in the title of a page. Shorthand and redirects for templates consist of many variations of the template name. Both short and long. Separating them to different parts of the documentation page serves no purpose except to confuse users of templates. Users may create more redirects, not knowing what already exists. Some users may be less likely to use the templates. Because they can't remember the exact original name of the template. I think the "redirects" link (WhatLinksHere hiding links and transclusions) should be on all template pages. Automatically created by TemplateBox. Sometimes the "redirects" link (WhatLinksHere hiding links and transclusions) is added to a template page, but the additional redirects disappear because some clueless admin deleted the redirects, and then it seems like it serves no purpose. Some people go around changing the name of redirects on the pages where they are being used. A big mistake. Then it seems like the redirect is not being used. So it gets deleted. The person who created the redirect then stops contributing to the Commons, at least as concerns that template, because people are ruining their work, and they can no longer remember the name of the template. Many people don't know how to look for redirects. The point is to make it easy for users to use templates. The "redirects" link (WhatLinksHere hiding links and transclusions) makes using templates easier. --Timeshifter (talk) 08:38, 7 February 2015 (UTC)
FWIW: {{TemplateBox|shorthand={{redirects|Metacat}}}} should works as documented for {{redirects}}, and all bare {{TemplateBox|shorthand={{tl|Metacat}}}} constructs should be updated by a bot. Only the remaining cases should be kept as is. This will have your desired backlink effect on explicitly enumerated aliases, i.e., the alias gets a link from the /doc subpage.
I still doubt that listing {{ucfirst:{{lc:CamelCase}}}} is necessary, only a maniac would delete Camelcase. Example, there are three {{Cc-by-sa-3.0-igo}} spelling variations (invented by the ESA), all tagged as redirects to a license template. Counter-example, I created {{EmptyCatGood}} as redirect to {{empty category}}, because I like the funny mediawikiwiki name, but I'd have no objection to an import of the real thing. After all redirects can be expanded into separate pages in all namespaces. –Be..anyone (talk) 20:49, 9 February 2015 (UTC)
Redirects don't have anything to do with the template itself, and listing them doesn't provide users with any useful additional information. Therefore, they shouldn't be added to /doc pages, and this edit should be reverted.    FDMS  4    20:18, 16 February 2015 (UTC)
The docs have long had redirects. The template is a more recent invention. And shorthand redirects are still redirects. Shorter redirects are not necessarily easier to remember than longer redirects. And that is the point of all of these redirects, easy memory. --Timeshifter (talk) 00:13, 18 February 2015 (UTC)
I'm not going to use the {{esoteric}} {{TemplateBox}} in any past, present, or future shape anywhere, the "template data manager" i18n now passes "good enough" and is available on all WikiMedia projects. This also solves the "seealso=" conflict, without the {{TemplateBox}} abomination {{redirects}} works as designed. –Be..anyone (talk) 04:06, 18 February 2015 (UTC)