Template:TemplateBox
More actions
This template ({{TemplateBox}}) eases documentation of (other) templates. Using it helps uniformizing template documentation pages. See: Commons:Template documentation and Commons:TemplateData.
Usage
Usage notes: For a code template (for copy-pasting) with short parameter descriptions, see section Template to create a new template documentation page
The template takes no parameters.
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:
See also
Localization
العربية ∙ Boarisch ∙ беларуская (тарашкевіца) ∙ বাংলা ∙ català ∙ čeština ∙ dansk ∙ Deutsch ∙ Deutsch (Sie-Form) ∙ Zazaki ∙ English ∙ español ∙ eesti ∙ euskara ∙ فارسی ∙ suomi ∙ français ∙ galego ∙ ગુજરાતી ∙ עברית ∙ हिन्दी ∙ hrvatski ∙ magyar ∙ Bahasa Indonesia ∙ italiano ∙ 日本語 ∙ 한국어 ∙ Lëtzebuergesch ∙ latviešu ∙ македонски ∙ മലയാളം ∙ मराठी ∙ Bahasa Melayu ∙ မြန်မာဘာသာ ∙ norsk bokmål ∙ Plattdüütsch ∙ Nederlands ∙ norsk nynorsk ∙ polski ∙ português ∙ português do Brasil ∙ русский ∙ sicilianu ∙ slovenčina ∙ slovenščina ∙ српски / srpski ∙ svenska ∙ ไทย ∙ Türkçe ∙ українська ∙ Tiếng Việt ∙ 中文 ∙ 中文(简体) ∙ 中文(繁體)
This template makes use of {{Autotranslate}} and the translate extension. The layout of the template can be found under Template:TemplateBox/layout.
Template to create a new template documentation page
The following code template contains brief descriptions for each parameter as well as space for categories and can be copy-pasted in new documentation pages. The meta-parameters are not internationalized (names have no language code).
{{TemplateBox
<!-- TEMPLATE PARAMETERS SECTION (for 2nd parameter, copy, paste & change "1" → "2") -->
|1 = <!-- 1st parameter: name of the first parameter the template takes-->
|1label = <!-- 1st parameter: label, very brief name, preferably less than 20 characters -->
|1d = <!-- 1st parameter: description (+LANGUAGE CODE) -->
|1d-td = <!-- 1st parameter: description for TemplateData without any wiki markup (+LANGUAGE CODE) -->
|1aliases = <!-- 1st parameter: alternative names that may be used, separated by "/" -->
|1type = <!-- 1st parameter: type (values: number, string, line, boolean, date, url, wiki-page-name, unknown/…) -->
|1set = <!-- 1st parameter: set ID / Label (to group multiple parameters in a set) -->
|1def = <!-- 1st parameter: fixed default value (+LANGUAGE CODE) -->
|1av = <!-- 1st parameter: autovalue, dynamically-generated default value, e.g. current year -->
|1sv = <!-- 1st parameter: suggested values to help users select the desired value, separated by "/" -->
|1stat = <!-- 1st parameter: status (values: required, optional, optional- or deprecated) -->
<!-- TEMPLATE SECTION -->
|useTemplateData = <!-- expose TemplateData (values: true, export; default: false) -->
|name = <!-- template title -->
|desc = <!-- template description (+LANGUAGE CODE) -->
|namespace = <!-- namespaces, the template is intended to be used (values: all, File, Category…) -->
|usergroup = <!-- usergroup that is meant to use the template (values: all, admin…) -->
|placement = <!-- placement on the page (values: top, bottom, licence or source) -->
|usage-notes = <!-- notes about the correct usage of the template -->
|type = <!-- template type (values: infobox, formatting, licence tag,…) -->
|example = <!-- example parameter values -->
|example-value = <!-- example invocation of the template with the values of the example parameter -->
|i18n-method = <!-- translation method (values: mediawiki-msg, ext.translate, autotranslate…) -->
|i18n-desc = <!-- translation info -->
|i18n-mediawiki-msg = <!-- name of the message when using “mediawiki-msg” as method -->
|i18n-subpage = <!-- translation subpage when using "ext.translate" as method -->
|i18n-data-file = <!-- tabular data file on Wikimedia Commons in the Data namespace -->
|seealso = <!-- relevant links (each of them on a new code line with * in the beginning) -->
|setscats = <!-- categories which are automatically set by the template -->
|print = <!-- template code layout in the Usage-section (values: one, multi, infobox) -->
|shorthand = <!-- redirects to the main template -->
|relieson = <!-- list of templates on which the template's basic functionality relies -->
|mustbesubst = <!-- set to yes (or any value) if the template must be substituted. -->
|docsub-page = <!-- page parameter from {{Documentation subpage}} -->
}}<includeonly>{{Sandbox other||
<!-- Categories below this line; interwikis at Wikidata -->
}}</includeonly>
TemplateData
{{Commons:TemplateData}}
Disadvantage: section edition links
One issue caused by usage of this template is the loss of 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).
This can be worked around by manually invoking {{Sed}} in each section to create an edit link anyway, but this technique is fragile since the first argument for {{Sed}} can change when the section structure changes, which quietly breaks such links. The link in this very section was broken for years, pointing to the wrong section, until the value was updated ({{Sed|1}} → {{Sed|3}}). Moreover, {{Sed}} wastes vertical space (standing on its own line).