跳至內容

模板:TemplateBox/doc

維基百科,自由的百科全書

<translate> </translate>

The template provides a uniform way to provide basic information about the use of a template. See: Commons:Template documentation and Commons:TemplateData.

<translate> Usage</translate>

{{TemplateBox
 |desc               =
 |print              =
 |namespace          =
 |shorthand          =
 |usergroup          =
 |relieson           =
 |placement          =
 |usage-notes        =
 |1def               =
 |type               =
 |example            =
 |1stat              =
 |example-value      =
 |i18n-method        =
 |useTemplateData    =
 |i18n-desc          =
 |mustbesubst        =
 |setscats           =
 |1                  =
 |1d                 =
 |name               =
 |seealso            =
 |i18n-mediawiki-msg =
 |1d-td              =
 |1type              =
 |i18n-subpage       =
}}

模板參數

參數描述預設狀態
desc
desc-en
description
description-en
desc-td
description-td
description (template)description of what the template does Template:TemplateBox/use suffixempty必填
printprintThe 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 =.LangSwitch Error: no default非必填
1setset (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非必填
namespacenamespacenamespaces, the template is intended to be used in; possible values:

Template:TemplateBox/doc/nslist

Any other values will show as 「unknown」.
LangSwitch Error: no default必填
shorthandshorthandshorthand for easy use (redirects to main template). See examples here and here of lists of redirects, and searches for more.empty非必填
usergroupusergroupusergroup that is meant to use the template; possible values: Template:TemplateBox/doc/usergroupLangSwitch Error: no default必填
reliesonrelies onlist of templates on which the template's basic functionality reliesempty非必填
placementplacementplacement on the page. Possible values:
top
bottom
licence
source
empty非必填
usage-notesusage-notesnotes about the correct usage of the templateempty非必填
1def
1def-td
1default
default (param)default value for the parameter (similarly 2def, 3def, …) Template:TemplateBox/use suffixempty非必填
typetype (template)what type is the template (infobox, formatting, licence tag, …)empty非必填
exampleexampleExample use (works with a single unnamed parameter only). There is also example2 for a second example.empty非必填
1aliasesaliases (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非必填
1stat
1stat-td
1deprecated
1required
status (param)status of the parameter (similarly 2stat, 3stat, …); possible values:
required[需要解釋]
optional
optional-
optional and not present in the standard form
deprecated
optional非必填
example-valueexample-resultIf there is more than one parameter you would like to show or if there are named parameters, use: Template:TemplateBox/doc/example-valueempty非必填
i18n-methodtranslation methodmethod the localization is achieved by. Known values:
autotranslate
using {{autotranslate}} or applying a similar method
switch
using {{LangSwitch}} in the template itself
-
no localization needed
custommediawiki-msg
using MediaWiki namespace messages
mediawiki-msg
using MediaWiki namespace messages, translated on translatewiki.net
ext.translate
using {{autotranslate}} or applying a similar method on a subpage that is marked for translation using the translate extension
empty非必填
useTemplateDataexpose TemplateDataWhether 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.empty建議
i18n-desctranslation infoadditional info about the localizationempty非必填
mustbesubstmust be substSet to "yes" (or any value) if the template must be substituted. This puts "subst:" into the template example under "usage".empty非必填
lines
print
Use parameter print instead.empty非必填
setscatscategorizes intowhat categories are automatically set by the template (put in a linked list of them)empty非必填
1name (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非必填
1d
1d-en
1description
1description-en
description (param)description of the parameter (similarly 2d, 3d, …) Template:TemplateBox/use suffixempty非必填
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. Template:TemplateBox/use suffixempty非必填
nametitle (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}}必填
seealsosee alsorelevant links (put in a list of them)empty非必填
i18n-mediawiki-msgmediawiki-messageWhen using 「mediawiki-msg」 as method, optionally put the name of the message here. Falls back to:empty非必填
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. Template:TemplateBox/use suffixempty非必填
1typetype (param)The type of the parameter, for (soft) type hinting. Please refer to the list of possible values.empty非必填
i18n-subpagetranslation-subpageWhen 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非必填

<translate> Additional information</translate>

<translate> The template is intended to be used in the following namespaces:</translate> <translate> the Template namespace</translate>

<translate> The template is intended to be used by the following user groups:</translate> <translate> all users</translate>

<translate> Placement:</translate> <translate> </translate>

in the '/doc' subpage of a template

<translate> Relies on:</translate>

<translate> ⧼Seealso⧽</translate>

<translate> </translate>

<translate> Localization</translate>

Template:Lang links

<translate> This template makes use of <tvar name="autotranslate">{{Autotranslate}}</tvar> and [[<tvar name="linktarget">:mw:Special:MyLanguage/Help:Extension:Translate</tvar>|the translate extension]].</translate> Template:Tmpl

[[[:Template:TranslateLink]] <translate> Translate this template now!</translate>]

About: TemplateData

{{Commons:TemplateData}}

Complications

( NOTE : the {{sed|1}} template links appears HERE : >>> ) Template:Sed 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.