Difference between revisions of "Template:TemplateBox/doc"
Mediawiki>ExE Boss (Enable and improve documentation for `i18n‑method=TNT` and the `i18n‑data‑file` parameter) |
(Created page with "{{Shared Template Warning|Template:TemplateBox|origin=Commons}} <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> {{#ifeq:{{SUBPAGE...") |
(No difference)
|
Revision as of 19:36, 20 January 2022
warning Warning: | Do not edit. This page is maintained by an automated tool. All edits should be done at commons.wikimedia.org. (translate this warning) |
30px | This template uses Lua: |
32px | This template uses TemplateStyles: |
This is a documentation subpage for . It contains usage information, categories and other content that is not part of the original template page. |
The template provides a uniform way to provide basic information about the use of a template. See: Commons:Template documentation and Commons:TemplateData.
Usage
{{TemplateBox
|1 =
|1d =
|1d-td =
|1type =
|1def =
|1stat =
|useTemplateData =
|name =
|desc =
|namespace =
|usergroup =
|placement =
|usage-notes =
|type =
|example =
|example-value =
|i18n-method =
|i18n-desc =
|i18n-mediawiki-msg =
|i18n-subpage =
|i18n-data-file =
|seealso =
|setscats =
|print =
|shorthand =
|relieson =
|mustbesubst =
|docsub-page =
}}
Template parameters
Parameter | Description | Default | Status | |
---|---|---|---|---|
1 | name (param) | parameter name (similarly 2, 3, …). Note that if all of the parameters beginning with a number are removed from the template, the usage notes will state "The template takes no parameters." | empty | optional |
1d 1d-en 1description 1description-en | description (param) | description of the parameter (similarly 2d, 3d, …) -langcode | empty | optional |
1d-td 1d-td-en 1description-td 1description-td-en | TemplateData description (param) | description of the parameter (similarly 2d-td, 3d-td, …) for Extension:TemplateData which does not accept Wiki-markup. If this parameter is omitted, 1d is used. You can always override the defaults specifically for TemplateData by appending -td to the parameter-name. You can specify a language by appending your language-code. E.g. 3d-td-en would be the English translation of the description of parameter 3 which will be used in TemplateData. -langcode | empty | optional |
1label 1label-en 1label-td 1label-td-en | label (param) | A (very) brief name for the parameter. Try to keep under 20-ish characters. 1label-de would be the German translation of this label. -langcode | empty | optional |
1aliases | aliases (param) | List of aliases. An alias is an alternative name for the parameter that may be used instead of (not in addition to) the primary name. Separate them by / (a slash) | empty | optional |
1type | type (param) | The type of the parameter, for (soft) type hinting. Please refer to the list of possible values. | empty | optional |
1set | set (param) | Label and ID of a set in one. Multiple parameters can be grouped in a set, if either none or all of them must be supplied. Try to keep under 20-ish characters. | empty | optional |
1def 1def-td 1default | default (param) | default value for the parameter (similarly 2def, 3def, …) -langcode | empty | optional |
1stat 1stat-td 1deprecated 1required | status (param) | status of the parameter (similarly 2stat, 3stat, …); possible values:
| optional | optional |
useTemplateData | expose TemplateData | Whether the template should expose TemplateData - omitting means "false". Setting to 1 , true , or yes means "true". Setting to only will suppress the house-made table. Setting useTemplateData to export will turn TemplateBox into a preformatted Copy & Paste template. Seting to TNT or TNT:template name will cause TemplateData to be handled handled by Module:TNT. | empty | suggested |
name | title (template) | name of the template (needed for viewing the documentation on another page than the template page, in particular for viewing the documentation page separately) | {{BASEPAGENAME}} | required |
desc desc-en description description-en desc-td description-td | description (template) | description of what the template does -langcode | empty | required |
namespace | namespace | namespaces, the template is intended to be used in; possible values:
| no namespace specified | required |
usergroup | usergroup | usergroup that is meant to use the template; possible values:
| no user group specified | required |
placement | placement | placement on the page. Possible values:
| empty | optional |
usage-notes | usage-notes | notes about the correct usage of the template | empty | optional |
type | type (template) | what type is the template (infobox, formatting, licence tag, …) | empty | optional |
example | example | Example use (works with a single unnamed parameter only). There is also example2 for a second example. | empty | optional |
example-value | example-result | If there is more than one parameter you would like to show or if there are named parameters, use: {{TemplateBox
|name=SampleTemplate
|example=param1=value1{{!}}param2=value2
|example-value={{SampleTemplate
|param1=value1
|param2=value2
|category=
}}
}}
| empty | optional |
i18n-method | translation method | method the localization is achieved by. Known values:
| empty | optional |
i18n-desc | translation info | additional info about the localization | empty | optional |
i18n-mediawiki-msg | mediawiki-message | When using “mediawiki-msg” as method, optionally put the name of the message here. Falls back to: | empty | optional |
i18n-subpage | translation-subpage | When using “ext.translate” as method, optionally put the name of the sub-page here. A dot (. ) means that the current template hosts the translation on its subpages directly. | i18n | optional |
i18n-data-file | I18n Data File | The tabular data file on Wikimedia Commons in the Data namespace. The I18n/ prefix and the .tab file extension are added automatically if its missing. | I18n/{{{name}}}.tab | optional |
seealso | see also | relevant links (put in a list of them) | empty | optional |
setscats | categorizes into | what categories are automatically set by the template (put in a linked list of them) | empty | optional |
print | The way the parameters are typically arranged (horizontally or vertically). Possible values: multi - parameters arranged in multiple lines; one - one line; infobox - multiple lines and space padding in front of the =. | one (if type param ≠ infobox) | optional | |
lines print | Use parameter print instead. | empty | optional | |
shorthand | shorthand | shorthand for easy use (redirects to main template). See examples here and here of lists of redirects, and searches for more. | empty | optional |
relieson | relies on | list of templates on which the template's basic functionality relies | empty | optional |
mustbesubst | must be subst | Set to "yes" (or any value) if the template must be substituted. This puts "subst:" into the template example under "usage". | empty | optional |
docsub-page | {{Documentation subpage}} page parameter | {{NAMESPACE}}:{{BASEPAGENAME}} | optional |
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard. Existing template documentation Newly created template documentation and imports Wikipedia's help about TemplateData • Commons-specific information Unexpected property "params.1stat.suggestedvalues". |
Additional information
The template is intended to be used in the following namespaces: the Template namespace
The template is intended to be used by the following user groups: all users
Placement:
in the '/doc' subpage of a template
Relies on:
⧼Seealso⧽
Localization
This template makes use of {{Autotranslate}} and the translate extension. The layout of the template can be found under Template:TemplateBox/layout.
About: TemplateData
{{Commons:TemplateData}}
Complications
( NOTE : the {{sed|1}} template links appears HERE : >>> )
A complication is that the template suppresses section editing links on the whole page of the documented template, and also on its documentation page, even for paragraphs outside the part produced by this template TemplateBox. Template:Sed can be used (as is done here) to create an edit link anyway.