Template:Documentation/doc
Lua error in Module:TNT at line 182: Missing Commons dataset I18n/Module:TNT.tab. Lua error in Module:TNT at line 182: Missing Commons dataset I18n/Module:TNT.tab.
__EXPECTED_UNCONNECTED_PAGE__
This template automatically displays a green documentation box like you are seeing now, and automatically loads the content from a /doc subpage. It can also load the content from other places if instructed to. It is intended for pages which are transcluded in other pages, i.e. templates, whether in the template namespace or not.
Usage
{{Documentation |1= }}
This template allows any page to use any documentation page, and makes it possible to protect templates while allowing anyone to edit the template's documentation, and categories. It also reduces server resources by circumventing a technical limitation of templates (see a developer's explanation).
Normally this template is used without any parameters, placed at the bottom of the template or page being documented, within a <noinclude>...</noinclude>
container:
<!--Last line of your template code--><noinclude> {{Documentation}} <!-- Add categories to the /doc subpage --> </noinclude>
Then this template automatically loads the content from the /doc subpage of the template it is used on.
This template can also load the content from any other page. Like this:
<!--Last line of your template code--><noinclude> {{Documentation |Template:Other page/doc}} </noinclude>
Note that when loading the documentation from a page other than the local /doc page it becomes tricky to handle the categories.
The content can also be fed directly as text. Like this:
<!--Last line of your template code--><noinclude> {{Documentation | content = (some documentation) }}</noinclude>
When the |content=
parameter is used, the doc box normally does not show the [edit] [purge] links in the top right corner. Note that if the /doc page exists, a link to it is still shown in the link box below the doc box.
Parameter |1=
and the |content=
parameter can also be combined, like this:
<!--Last line of your template code--><noinclude> {{Documentation |1=Template:Any page/doc | content = {{Any page/doc |parameters}} }}</noinclude>
Then the pagename fed as parameter 1 is used for the [edit] [purge] links and for the /doc link in the link box below the doc box. But the content parameter is used for the content shown in the doc box. The above code means that the content is transcluded as {{Template:Any page/doc|parameters}}
. In this example a parameter is also fed to the /doc page being loaded.
If the documentation page contains includeonly or noinclude tags as part of the documentation, replace the "<" with "<".
Template parameters
پارامتر | توضیحات | پیشفرض | وضعیت | |
---|---|---|---|---|
1 | pagename | Template name (if there's no explicit namespace, the page is assumed to be in the "Template:" namespace; to specify a page in the main namespace, prefix it explicitly with ":") | The current template page with the suffix /doc | اختیاری |
heading 2 | heading text | Change the text of the "documentation" heading. If this is set to blank, the entire heading line (including the first [edit] link) will also disappear. If the documentation page doesn't exist, the "edit" link includes a preload parameter so that clicking it will pre-fill the edit form with the basic documentation page format. | icon and "Documentation" text | اختیاری |
content | content | The content of the documentation can also be fed directly as text, instead of being specified by the name of the page containing it (parameter |1= ). This option is mostly useful in a rare case where is a single documentation template is used to document many templates, with very little content change. In such a case, the |content= parameter can be used to call the documentation template with additional parameters, like content = {{Any doc page/doc |parameter1 |parameter2}} . See "Usage" section below for more examples and Category:Multi-template documentation for examples of template documentation pages used for more than one template. | empty | اختیاری |
Template data | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData راهی برای ذخیره اطلاعات الگو در مورد پارامترهای آن الگو (توضیحات مربوط به آن ها و کل الگو) برای انسان و ماشین است. TemplateData توسط VisualEditor و احتمالاً ابزارهای دیگری مانند Upload Wizard استفاده میشود. اسناد موجود در قالب اطلاعات الگوی جدید ایجاد شده و واردات ویکی پدیا در مورد TemplateData به کمک شما نیازمند است • اطلاعات خاص عمومی This template automatically displays a green documentation box like you are seeing now, and automatically loads the content from a /doc subpage. It can also load the content from other places if instructed to. It is intended for pages which are transcluded in other pages, i.e. templates, whether in the template namespace or not.
|
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: At the bottom of the page
Example
{{Documentation| |1={{FULLPAGENAME}} |content= == {{LangSwitch|en=Showcase|de=Schaufenster}} == {{LangSwitch |en=common case: |de=Normal- bzw. Standardfall: }} ::<pre>{{States of Germany|prefix=|suffix=}}</pre> ::{{States of Germany|prefix=|suffix=}} {{LangSwitch |en=optionally with flags: |de=Optional mit Länderflaggen: }} ::<pre>{{States of Germany|flags=yes}}</pre> ::{{States of Germany|flags=yes}} {{LangSwitch |en=optionally with coats of arms: |de=Optional mit Länderwappen: }} ::<pre>{{States of Germany|coats=yes}}</pre> ::{{States of Germany|coats=yes}} {{LangSwitch |en=optionally without text (affects accessibility negatively (!)): |de=Optional ohne Text (beeinträchtigt die Zugänglichkeit für einige Nutzergruppen stark negativ (!)): }} ::<pre>{{States of Germany|compact=yes|flags=only|flagssize=48px}}</pre> ::{{States of Germany|compact=yes|flags=only|flagssize=48px}} ::<pre>{{States of Germany|compact=yes|coats=only|coatssize=48px}}</pre> ::{{States of Germany|compact=yes|coats=only|coatssize=48px}} }}
renders as:
Showcase
common case:
{{States of Germany|prefix=|suffix=}}
- Lua error in Module:Catnav at line 278: attempt to index field 'wikibase' (a nil value).
optionally with flags:
{{States of Germany|flags=yes}}
- Lua error in Module:Catnav at line 278: attempt to index field 'wikibase' (a nil value).
optionally with coats of arms:
{{States of Germany|coats=yes}}
- Lua error in Module:Catnav at line 278: attempt to index field 'wikibase' (a nil value).
optionally without text (affects accessibility negatively (!)):
{{States of Germany|compact=yes|flags=only|flagssize=48px}}
- Lua error in Module:Catnav at line 278: attempt to index field 'wikibase' (a nil value).
{{States of Germany|compact=yes|coats=only|coatssize=48px}}
- Lua error in Module:Catnav at line 278: attempt to index field 'wikibase' (a nil value).
⧼Seealso⧽
Localization
This template makes use of {{Autotranslate}} and the translate extension. The layout of the template can be found under Template:Documentation/layout.
Additionally, this template makes use of Module:TNT and Data:I18n/Documentation.tab.