Template talk:TemplateBox

TemplateData containing markup edit

  Info Moved here from Template talk:TemplateBox/doc --W like wiki good to know 18:35, 4 February 2023 (UTC)Reply


There are 2 solutions: Turning off TemplateData and adding it as a JSON block (|useTemplateData=export, then pressing preview will give you a pre-formatted block for copy & pasting), simply ignoring the markup, as it is still legible, or using the according -td parameters (e.g. |28d-td-et in addition to |28d-et). -- Rillke(q?) 01:17, 7 January 2015 (UTC)Reply

Parameter relieson: German translate wrong edit

please replace

  • Liste der Vorlagen, auf der die Vorlage zurückgreift

by

  • Liste der Vorlagen, auf die die Vorlage zurückgreift

--Herzi Pinki (talk) 12:53, 13 May 2021 (UTC)Reply

Use single heading for all examples edit

{{Edit request}}

Please apply the following diffs:

Template:TemplateBox/i18n
--- a/Template:TemplateBox/i18n
+++ b/Template:TemplateBox/i18n
@@ -7,7 +7,10 @@
 No description yet available.</translate>
 |msg-languagedependant=<nowiki /><small><translate><!--T:3--> <!-- Remove this comment and insert the translation of "This part of the documentation is only available in a limited number of languages." --></translate></small>
 |msg-usage=<translate><!--T:4--> Usage</translate>
-|msg-example=<translate><!--T:5--> Example</translate>
+|msg-examples=<translate><!--T:5--> {{<tvar name=1>PLURAL:{{#expr:<!--
+	-->{{#if:{{{example|}}}|1|0}}<!--
+	-->+{{#if:{{{example2|}}}|1|0}}<!--
+-->}}</tvar>|Example|Examples}}</translate>
 |msg-example-renders-as=<translate><!--T:6--> renders as:</translate>
 |msg-shorthand=<translate><!--T:7--> Or use the shorthand</translate> <nowiki /><!--
              Some translations removed from translation (T8-T18)
Template:TemplateBox/layout
--- a/Template:TemplateBox/layout
+++ b/Template:TemplateBox/layout
@@ -111,8 +111,9 @@

 {{{msg-relieson|}}}<br />
 {{{relieson|}}}
-}}{{#if: {{{example|}}} |<nowiki/>
-== {{{msg-example|}}} ==
+}}{{#if: {{{example|}}}{{{example2|}}} |<nowiki/>
+== {{{msg-examples}}} ==
+<nowiki/>}}{{#if: {{{example|}}} |<nowiki/>

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

@@ -121,7 +122,8 @@
 {{#if:{{{example-value|}}}|{{{example-value}}}|{{{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}|{{{example|}}}|category=}}}}
 </div>
 }}{{#if: {{{example2|}}} |<nowiki/>
-== {{{msg-example|}}} ==
+{{#if: {{{example|}}}
+|<hr class="templatebox-examples-separator"/>}}

  <nowiki>{{</nowiki>{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}{{!}}{{{example2}}}<nowiki>}}</nowiki>
Template:TemplateBox/styles.css
--- a/Template:TemplateBox/styles.css
+++ b/Template:TemplateBox/styles.css
@@ -25,3 +25,7 @@
 	content: "";
 	clear: both;
 }
+
+hr.templatebox-examples-separator {
+	margin: 1em 0;
+}

in order to avoid duplicating the “Example” section header. — ExE Boss (talk) 23:45, 3 August 2021 (UTC)Reply

  Done 1989 (talk) 01:07, 4 August 2021 (UTC)Reply

Show message about the template layout subpage for i18n-method=ext.translate as well edit

{{Edit request}}

Please apply the following diffs:

Template:TemplateBox/i18n
--- a/Template:TemplateBox/i18n
+++ b/Template:TemplateBox/i18n
@@ -22,10 +22,12 @@
 |msg-localization=<translate><!--T:21--> Localization</translate>
 |msg-localization-instruct-switch=<translate><!--T:22-->
 To add your language to the list of languages supported by this template, please edit the template and add a row to the "<tvar name="template">{{Tlf|LangSwitch| }}</tvar>" construct. It takes the form "<tvar name="formattingBegin"><code>{{!}}xx=</tvar> Your translation <tvar name="formattingEnd"></code></tvar>" (<tvar name="samplecode"><code>xx</code></tvar> being the {{W|List of ISO 639-1 codes|code}} of your language)</translate>
-|msg-localization-instruct-autotranslate=<translate><!--T:23--> This template is localized through <tvar name="autotranslate">{{tl|Autotranslate}}</tvar>.</translate> {{#ifexist: Template:{{#if:{{{name|}}}|{{{name}}}|{{PAGENAME}}}}/layout | <translate><!--T:24--> The layout of the template can be found under <tvar name="link">[[Template:{{#if:{{{name|}}}|{{{name}}}|{{PAGENAME}}}}/layout]]</tvar>.</translate>}}
+|msg-localization-instruct-autotranslate=<translate><!--T:23--> This template is localized through <tvar name="autotranslate">{{tl|Autotranslate}}</tvar>.</translate>
 
-<translate><!--T:25-->
+<!-- $1 is automatically replaced by [[Template:TemplateBox/layout]] using {{tmpl}} -->
+|msg-localization-template-layout=<translate><!--T:24--> The layout of the template can be found under $1.</translate>
+|msg-localization-instruct-autotranslate-new=<translate><!--T:25-->
 To add your language to the list of languages supported by this template, please copy the code of <tvar name="pagetocopyfrom">[[Template:{{{name|{{PAGENAME}}}}}/en]]</tvar> (or any other language version you prefer to translate) and replace the text strings in there (the form below can be used to create a translation, the English version is preloaded in the edit box). Please change the parameter <tvar name="paramname"><code>lang</code></tvar> from <tvar name="defaultlang"><code>en</code></tvar> (or whatever language you are translating) to the [[:en:ISO 639-1|language code]] of your language.</translate>
 |msg-localization-instruct-none=<translate><!--T:26-->
 This template is not intended to be localized.</translate>
 |msg-localization-instruct-custommediawiki-msg=<translate><!--T:27-->
Template:TemplateBox/layout
--- a/Template:TemplateBox/layout
+++ b/Template:TemplateBox/layout
@@ -147,7 +147,15 @@
 
 {{lang links|Template:{{#if: {{{name|}}} | {{{name}}} | {{PAGENAME}} }}|suppressaddlink=true}}
 
-{{{msg-localization-instruct-autotranslate|}}}
+{{{msg-localization-instruct-autotranslate}}}
+{{#ifexist:Template:{{#if:{{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}/layout|
+{{tmpl|0=
+{{{msg-localization-template-layout}}}
+|1=[[Template:{{#if:{{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}/layout]]
+}}
+}}
+
+{{{msg-localization-instruct-autotranslate-new}}}
 
 {{#tag:inputbox|
 type=create
@@ -160,7 +168,13 @@
 
 {{lang links|suppressaddlink=true|1={{{i18n-subpage}}}}}
 
-{{{msg-localization-ext-translate|}}}
+{{{msg-localization-ext-translate}}}
+{{#ifexist:Template:{{#if:{{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}/layout|
+{{tmpl|0=
+{{{msg-localization-template-layout}}}
+|1=[[Template:{{#if:{{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}/layout]]
+}}
+}}
 
 <div style="text-align:center">{{Clickable button|target={{TranslateLink|{{{i18n-subpage}}}}}|text=[[File:Icono de traducción.svg|48px|link=]]'''{{{msg-localization-instruct-ext-translate}}}'''|class=ui-button-blue ui-button-large|external=true}}</div>

in order to display the link to the /layout subpage for templates which use Extension:Translate as well, e.g.: {{TemplateBox}} using {{TemplateBox/layout}}. — ExE Boss (talk) 08:40, 4 August 2021 (UTC)Reply

  Done 1989 (talk) 12:13, 4 August 2021 (UTC)Reply

Large number of expensive function calls edit

{{TemplateBox |name=Depicted font |i18n-method=ext.translate}} is making 498 out of 500 allowed "Expensive parser function count". Seems like one for every language supported by mediawiki. That is causing issues at pages like Template:Depicted font/doc or Template:Depicted logo/doc. Can someone look into why are we making so many Expensive parser function calls? A lot of pages are likely to break if number of supported languages goes over 500. --Jarekt (talk) 02:37, 17 February 2022 (UTC)Reply

All it does is calling {{Lang links}}. {{lang links|foo}} uses 494 “expensive parser functions” (of course, most if not all of these “expensive parser functions” are Lua functions, not wikitext parser functions). So that template should be debugged further. (By the way, the same issue is present for |i18n-method=autotranslate as well, since that also calls {{Lang links}}.) —Tacsipacsi (talk) 01:18, 18 February 2022 (UTC)Reply
The issue is that {{lang links}} uses {{#ifexist:}} under the hood for every supported language, of which there are almost 500, and when {{Documentation}} and {{TemplateBox}} are used on top, which also use expensive parser functions for their own needs, and it’s inevitable that the limit will be crossed. — ExE Boss (talk) 08:50, 26 February 2022 (UTC)Reply

doc-page: Parameter "1d-td" and "print" should not be presented in the standard form edit

Hello, Parameter 1d-td should not be presented in the standard form, because if so, and not filled (and only 1d-td = is in the code) the TemplateData description remains empty and 1d will not be used instead of 1d-td as it is described. So I suggest:

|30stat=optional- 

Same with parameter print: if not filled, the type parameter could be infobox and nevertheless it will be displayed in one line.

Regards, --W like wiki good to know 19:49, 8 November 2022 (UTC)Reply

  Done: As proposed, the stat for Parameter 1d-td is now "optional-" (see here)
  I withdraw my nomination: Parameter print is important and should be displayed in the standard form. The fact, that the changing of the type-parameter has no effect of the default value of the print paramter should be solved in an other task. Regards --W like wiki good to know 03:31, 4 February 2023 (UTC)Reply

Parameter "print" - dependency with "type"-parameter not working edit

Hello, on the doc page it is said, that parameter print is "one by default, if type parameter ≠ infobox". This dependency is not working at the moment! Even if the type parameter is infobox the print parameter is one by default. Regards --W like wiki good to know 03:41, 5 February 2023 (UTC)Reply

Parameter "example" and "example-value" edit

Hello, the names of the parameter example and example-value are reverse (or the use in the template code is reverse)!. At the moment:

  • parameter example is for one possible value of one (unnamed) paramter, e.g. lakes
  • parameter example-value is for one code-example of the template with the value of the example-param. e.g. {{catseealso|lakes}}

The code on the doc-page of Template:catseealso will be:

|example       = lakes
|example-value = {{catseealso|lakes}}

which will renders on the doc page as:

Example
{{catseealso|lakes}}

renders as:

So "lakes" should be the example-value and "{{catseealso|lakes}}" the example(-use). Regards --W like wiki good to know 22:22, 8 November 2022 (UTC)Reply

doc-page: Paramter "lines" should set to deprecated edit

As it is mentioned in the hidden comment behind |280stat=optional:

"The stat-value of the lines parameter should set to deprecated as soon as https://bugzilla.wikimedia.org/show_bug.cgi?id=52676 is fixed." 

Regards --W like wiki good to know 00:41, 9 November 2022 (UTC)Reply

  Done https://bugzilla.wikimedia.org/show_bug.cgi?id=52676 is Closed/Declined, so I changed the value now to "deprecated". Regards --W like wiki good to know 12:01, 10 February 2024 (UTC)Reply

doc-page: Parameters "1sv" and "1av" are not explained edit

Hello, what about the strange …sv and …av parameters in doc page code? They are not explained in the doc-page itself. Here a copy of the code:

|100 = 1stat
>  |100sv = required/suggested/optional/optional-/deprecated

|110 = useTemplateData
>  |110sv = 1/only{{Sandbox other|/TNT/TNT:{{((}}subst:BASEPAGENAME{{))}}}}
A  |110av = only

|150 = usergroup
>  |150sv = all/bot/administrator/admin/sysop/bureaucrat/crat/checkuser/licensereviewer/otrs/autoconfirmed/autopatrolled/filemover/oversight/patroller/rollbacker/steward/upwizcampeditors

|160 = placement
>  |160sv = top/bottom/license/source

<!-- TODO: Document all values for the “type” parameter and their meaning -->
>  |18sv = infobox/formatting/license tag/cleanup

|210 = i18n-method
>  |210sv = -/autotranslate/ext.translate/switch/mediawiki-msg/custommediawiki-msg/TNT

|245 = i18n-data-file
A  |245av = I18n/{{subst:ROOTPAGENAME}}.tab

|270 = print
>  |270sv = multi/one/infobox

Regards --W like wiki good to know 00:56, 9 November 2022 (UTC)Reply

  Half done By this edit: sv meaning Suggested values. For the rest: av meaning autovalue, see; mw:Extension:TemplateData#Param object. --W like wiki good to know 23:06, 14 February 2024 (UTC)Reply
  Done By this edit. --W like wiki good to know 00:32, 15 February 2024 (UTC)Reply

doc-page: What for is Parameter "1set"? edit

Hello, what exactly is the function of parameter 1set? An example value or example use could be helpful for understanding. Or are there other templates using this parameter? which could be mentioned similiar to the description of Parameter shorthand. Thx --W like wiki good to know 09:10, 9 November 2022 (UTC)Reply

doc-page: What for is Parameter "type"? edit

Hello, what exactly is the function of parameter type? The doc page says: "the type what the template is, (infobox, formatting, licence tag, …)" but what does it mean exaclty? For what is it important? What are the other possible types beside of infobox, formatting and licence tag? Are there example templates using this parameter? --W like wiki good to know 02:06, 9 November 2022 (UTC)Reply

doc-page: What for is Parameter "usage-notes"? edit

Hello, what exactly is the function of parameter usage-notes? An example value or example use could be helpful for understanding. Or are there other templates using this parameter? which could be mentioned similiar to the description of Parameter shorthand. Thx --W like wiki good to know 09:10, 9 November 2022 (UTC)Reply

@W like wiki: You can add own notes below of the first headline "Usage" (or whatever it is in other languages). Just try it ! -- sarang사랑 10:20, 19 November 2022 (UTC)Reply
Ok Thank You so much @Sarang: so I expanded a bit the explanation of the parameter (and here) in the doc page. Regards --W like wiki good to know 01:14, 4 February 2023 (UTC)Reply
  Done So I Think it's done, are you agree @Sarang: ? --W like wiki good to know 01:17, 4 February 2023 (UTC)Reply

For some paramters language code is missing edit

Hello, for some paramters the language code is missing. Is that correct?

  |100def = optional
...
  |120def = <small>{{'''BASE'''PAGENAME}}</small>
...
  |140def     = no namespace specified
...
  |150def       = no user group specified
...
  |240def = i18n
...
  | 245def  = I18n/{{{name}}}.tab
...
  |270def = one (if type param ≠ '''infobox''')
...
  |320def = <span class="monospaced nowrap">{{magic word|NAMESPACE}}:{{magic word|BASEPAGENAME}}</span>

Regards --W like wiki good to know 14:47, 9 November 2022 (UTC)Reply

Edit request edit

Hi @Jarekt: Jarek, you are maintaining also the TemplateBox. I am abusing it for also a Module description and it works fine.
It would be better when in the case that it is used in the namespace 828

  • no Usage data is displayed (only usage notes)
  • instead of "Template parameters" either "Module parameters" is displayed, or nothing - then it can be done individually with the usage notes.

Or a parameter will allow ro suppress borh. It is not a strong need, just a nice-to-have. -- sarang사랑 10:40, 19 November 2022 (UTC)Reply

sarang, I do not know much about TemplateBox. I might help out sometimes by fulfilling an edit request, but it has to be something quite simple. I looked for where some text is licalized and found template:TemplateBox/i18n I did not find "Template parameters" but did find 70+ other phrases with the work "template". It would be a big job to modify this template to also work well for Modules, it almost might make more sense to clone it to ModuleBox and modify the clone. --Jarekt (talk) 00:58, 20 November 2022 (UTC)Reply

It is just that I saw you as the last editor, and thought you know everything about & it is very easy to you. Thank you, forget it, I can live well with the current situation.
Currently mine is the only parameter description for modules; when more modules will need it I can think about again -- sarang사랑 06:14, 20 November 2022 (UTC)Reply

doc-page: Put parameter "usage-notes" and "shorthand" together edit

Hello, On the doc pages the shorthands are listed beneath the usage code example and above the usage-notes if given. So similar to this I propose to change the order of the parameters on the docpage and move shorthands from #290 to #165 above usage-notes (#170). Regards --W like wiki good to know 02:53, 4 February 2023 (UTC)Reply

Probably a BUG! - copy-paste form in usage section evokes errors edit

Hello, if you use the standard copy-paste form in usage section it evokes errors. See example:

Strangely the errors does not occur if you copy & paste from the forms in section Usage – with short parameter descriptions. Regards, --W like wiki good to know 19:06, 4 February 2023 (UTC)Reply

I don't know who solved it, but thx!  A flower for you! If someone is interested I also can now add some more infos i got: It had something to do with the 2 different spaces before the "|" from the line of code |usage-notes downwards, anyway! --W like wiki good to know 19:34, 9 February 2024 (UTC)Reply
  Resolved

Displays poorly in mobile edit

This template is a big mess when viewed on the mobile site (example). This is mainly due to all of the collapsed or hidden content being displayed, including the lengthy documentation about what TemplateData is, which is normally only displayed when you click the little '?' button. Personally, I don't see why we need to include documentation about what TemplateData is within the TemplateBox output. If someone wants to know what TemplateData is, they can simply click on the big header link that says "Template data". We either need to remove this or fix it on mobile. Nosferattus (talk) 15:58, 12 June 2023 (UTC)Reply

 
It is requested that an edit or modification be made to this protected page.
Administrators/template editors: Please apply <nowiki> or {{Tl}} to the tag after the request is fulfilled.

Reinhard Müller

Please remove the code that produces the '?' button and it's related content. Nosferattus (talk) 16:01, 12 June 2023 (UTC)Reply

The big header with the link is only present if |useTemplateData=1 is used (e.g. {{Consent}}), not when |useTemplateData=only is used (e.g. {{!((}}). While I agree displaying all the usage information on mobile without the ability to collapse is awful, there should be a link even if |useTemplateData=only is used. (Also, the header currently links to mw:Extension:TemplateData, only the yellow-background help text links to Commons:TemplateData. However we end up displaying the link, I think it should point to Commons, as the Commons page links to mediawiki.org, but not the other way round.) —Tacsipacsi (talk) 14:55, 13 June 2023 (UTC)Reply

Please add "wikidata" as a new possible value for i18n-method edit

 
It is requested that an edit or modification be made to this protected page.
Administrators/template editors: Please apply <nowiki> or {{Tl}} to the tag after the request is fulfilled.

Reinhard Müller

Meanwhile it is not unusual to localize templates by displaying the Wikidata label, description, or sitelink in the user's preferred language for one or more Wikidata entities. Examples include {{Q}} or {{Navigation by states of Austria}}. Please extend the possible values for the i18n-method parameter by wikidata here and in the documentation and create the matching Category:Templates using Wikidata for internationalisation. Thanks --Reinhard Müller (talk) 08:35, 10 March 2024 (UTC)Reply

Return to "TemplateBox" page.