Template:TemplateBox: Difference between revisions
More actions
←Created page with '{{TemplateBox/{{Fallback|TemplateBox}} |1={{{1|}}}|1d={{{1d|}}}|1def={{{1def|}}}|1stat={{{1stat|}}}|2={{{2|}}}|2d={{{2d|}}}|2def={{{2def|}}}|2stat={{{2stat|}}} |3=...' |
mNo edit summary |
||
| Line 10: | Line 10: | ||
|17={{{17|}}}|17d={{{17d|}}}|17def={{{17def|}}}|17stat={{{17stat|}}}|18={{{18|}}}|18d={{{18d|}}}|18def={{{18def|}}}|18stat={{{18stat|}}} | |17={{{17|}}}|17d={{{17d|}}}|17def={{{17def|}}}|17stat={{{17stat|}}}|18={{{18|}}}|18d={{{18d|}}}|18def={{{18def|}}}|18stat={{{18stat|}}} | ||
|19={{{19|}}}|19d={{{19d|}}}|19def={{{19def|}}}|19stat={{{19stat|}}}|20={{{20|}}}|20d={{{20d|}}}|20def={{{20def|}}}|20stat={{{20stat|}}} | |19={{{19|}}}|19d={{{19d|}}}|19def={{{19def|}}}|19stat={{{19stat|}}}|20={{{20|}}}|20d={{{20d|}}}|20def={{{20def|}}}|20stat={{{20stat|}}} | ||
|name={{{name|}}}|desc={{{desc|}}}|namespace={{{namespace|}}}|usergroup={{{usergroup|}}}|usage-notes={{{usage-notes|}}}|type={{{type|}}}|example={{{example|}}}|i18n-method={{{i18n-method|}}}|i18n-desc={{{i18n-desc|}}}|seealso={{{seealso|}}}|setscats={{{setscats|}}}|lines={{{lines|}}}|shorthand={{{shorthand|}}} | |name={{{name|}}}|desc={{{desc|}}}|namespace={{{namespace|}}}|usergroup={{{usergroup|}}}|usage-notes={{{usage-notes|}}}|type={{{type|}}}|example={{{example|}}}|i18n-method={{{i18n-method|}}}|i18n-desc={{{i18n-desc|}}}|seealso={{{seealso|}}}|setscats={{{setscats|}}}|lines={{{lines|}}}|shorthand={{{shorthand|}}}|docsub-override={{{docsub-override|}}}|docsub-page={{{docsub-page|}}} | ||
}}<noinclude> | }}<noinclude> | ||
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> | ||
Revision as of 00:49, 1 February 2009
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).