Doc/Template – Template

From Bohemia Interactive Community
m (Text replacement - "<tt>([^ =]+)<\/tt>" to "{{hl|$1}}")
m (Fix text)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{{descr|}}}
<includeonly>{{#if:{{{historical|}}}|{{Feature|important|This is a {{Link|Category:Historical Templates|Historical Template}} kept in order to read old page revisions; it must '''not''' be used on up-to-date pages.}}}}
{{{descr|}}}


This template is used on [[Special:WhatLinksHere/{{FULLPAGENAMEE}}|these pages]].
{{#if:{{{historical|}}}
| This {{Link|Category:Historical Templates|Historical Template}} must '''not''' be used on any current page; please verify [[Special:WhatLinksHere/{{FULLPAGENAMEE}}|this list]] is empty.
| This template is used on [[Special:WhatLinksHere/{{FULLPAGENAMEE}}|these pages]].
}}


== Usage ==
== Usage ==
Line 113: Line 117:
}}
}}


{{#ifeq: {{uc:{{FULLPAGENAME}}}} | TEMPLATE:DOC/TEMPLATE | | [[Category: Templates|{{uc:{{PAGENAME}}}}]] }}</includeonly><noinclude>{{TOC|none}}
{{#ifeq: {{uc:{{FULLPAGENAME}}}} | TEMPLATE:DOC/TEMPLATE | | {{TemplateCase|[[Category:{{#if:{{{historical|}}}|Historical Templates|Templates}}|{{uc:{{PAGENAME}}}}]]}} }}</includeonly><noinclude>__NOEDITSECTION____NOTOC__
Documents and categorises a [[:Category:Templates|Template]]. To be used within {{hl|<no<nowiki/>include></no<nowiki/>include>}} tags, e.g:
Documents and categorises a [[:Category:Templates|Template]]. To be used within {{hl|<no<nowiki/>include></no<nowiki/>include>}} tags, e.g:
  <include<nowiki/>only>'''*template's code*'''</include<nowiki/>only><no<nowiki/>include>{{<nowiki/>'''Doc/Template'''
  <include<nowiki/>only>'''*template's code*'''</include<nowiki/>only><no<nowiki/>include>{{<nowiki/>'''Doc/Template'''
Line 121: Line 125:


== Usage ==
== Usage ==
{{<nowiki/>Doc/Template|'''''name'''''|'''''descr'''''|'''''param''#'''|'''''descr''#'''|'''''example''#'''|'''''result''#'''}}
{{<nowiki/>Doc/Template|'''''name'''''|'''''descr'''''|'''''param''#'''|'''''descr''#'''|'''''example''#'''|'''''result''#'''|'''''historical'''''}}
* name: (Optional, default {{hl|{{<nowiki/>PAGENAME}}}}) template name
* name: (Optional, default {{hl|{{<nowiki/>PAGENAME}}}}) template name
* descr: template text description
* descr: template text description
Line 128: Line 132:
* example#: (# = number range 1..10) mediawiki code example - '''to be wrapped between nowiki tags!''' (e.g {{hl|<nowiki><nowiki>{{Doc/Template}}</nowiki></nowiki>}})
* example#: (# = number range 1..10) mediawiki code example - '''to be wrapped between nowiki tags!''' (e.g {{hl|<nowiki><nowiki>{{Doc/Template}}</nowiki></nowiki>}})
* result#: (# = number range 1..10) mediawiki code result - identical to example#, less nowiki tags (e.g {{hl|<nowiki>{{Doc/Template}}</nowiki>}})
* result#: (# = number range 1..10) mediawiki code result - identical to example#, less nowiki tags (e.g {{hl|<nowiki>{{Doc/Template}}</nowiki>}})
* historical: {{hl|y}} (or anything, technically) to make it part of the [[:Category:Historical Templates|Historical Templates]] instead of the [[:Category:Templates|Templates]]
This template is used on [[Special:WhatLinksHere/{{FULLPAGENAMEE}}|these pages]].


{| style="border-spacing: 1em 0.5em; min-width: 50em"
{| style="border-spacing: 1em 0.5em; min-width: 50em"
Line 168: Line 175:
| example1 = <nowiki><nowiki>{{MyTemplate|Hello there!}}</nowiki></nowiki>
| example1 = <nowiki><nowiki>{{MyTemplate|Hello there!}}</nowiki></nowiki>
| result1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki>
| result1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki>
| historical = y
}}</pre>
}}</pre>


Line 179: Line 187:
| example1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki>
| example1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki>
| result1 = {{hl|Hello there!}}
| result1 = {{hl|Hello there!}}
| historical = y
}}
}}



Latest revision as of 01:43, 7 November 2025

Documents and categorises a Template. To be used within <noinclude></noinclude> tags, e.g:

<includeonly>*template's code*</includeonly><noinclude>{{Doc/Template
| ...
}}
</noinclude>

Usage

{{Doc/Template|name|descr|param#|descr#|example#|result#|historical}}

  • name: (Optional, default {{PAGENAME}}) template name
  • descr: template text description
  • param#: (# = number range 1..10) parameter name
  • descr#: (# = number range 1..10) parameter description
  • example#: (# = number range 1..10) mediawiki code example - to be wrapped between nowiki tags! (e.g </nowiki>)
  • result#: (# = number range 1..10) mediawiki code result - identical to example#, less nowiki tags (e.g {{Doc/Template}})
  • historical: y (or anything, technically) to make it part of the Historical Templates instead of the Templates

This template is used on these pages.

Examples
Code Result
{{Doc/Template}}


This template is used on these pages.

Usage

{{Doc/Template}}



{{Doc/Template
| name = MyTemplate
| descr = Template description
| param1 = parameter1
| descr1 = this is the first parameter
| param2 = parameter2
| descr2 = (Optional) this is the second parameter
}}

Template description

This template is used on these pages.

Usage

{{MyTemplate|parameter1|parameter2}}

  • parameter1: this is the first parameter
  • parameter2: (Optional) this is the second parameter



{{Doc/Template
| name = MyTemplate
| descr = Template description
| param1 = parameter1
| descr1 = this is the first parameter
| param2 = parameter2
| descr2 = (Optional) this is the second parameter
| example1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki>
| result1 = {{MyTemplate|Hello there!}}
| historical = y
}}
This is a Historical Template kept in order to read old page revisions; it must not be used on up-to-date pages.

Template description

This Historical Template must not be used on any current page; please verify this list is empty.

Usage

{{MyTemplate|parameter1|parameter2}}

  • parameter1: this is the first parameter
  • parameter2: (Optional) this is the second parameter
Examples
Code Result
{{MyTemplate|Hello there!}} Hello there!