Doc/Template – Template
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Template creation) |
Lou Montana (talk | contribs) m (Text replacement - "" to "") |
||
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{{{descr|}}} | <includeonly>{{{descr|}}} | ||
This template is used on [[Special:WhatLinksHere/{{FULLPAGENAMEE}}|these pages]]. | |||
== Usage == | == Usage == | ||
{{<nowiki/>{{{name|{{PAGENAME}}}}}<!-- | {{<nowiki/>{{{name|{{PAGENAME}}}}}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param1|}}} | {{!}}'''''{{{param1}}}'''''}}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param2|}}} | {{!}}'''''{{{param2}}}'''''}}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param3|}}} | {{!}}'''''{{{param3}}}'''''}}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param4|}}} | {{!}}'''''{{{param4}}}'''''}}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param5|}}} | {{!}}'''''{{{param5}}}'''''}}<!-- | ||
--><nowiki>}}</nowiki> | --><nowiki>}}</nowiki> | ||
{{#if:{{{ | {{#if:{{{param1|}}}| | ||
* {{{ | * {{{param1}}}{{#if:{{{descr1|}}}|<nowiki/>: {{{descr1|}}}}} | ||
}}<!-- | }}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param2|}}}| | ||
* {{{ | * {{{param2}}}{{#if:{{{descr2|}}}|<nowiki/>: {{{descr2|}}}}} | ||
}}<!-- | }}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param3|}}}| | ||
* {{{ | * {{{param3}}}{{#if:{{{descr3|}}}|<nowiki/>: {{{descr3|}}}}} | ||
}}<!-- | }}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param4|}}}| | ||
* {{{ | * {{{param4}}}{{#if:{{{descr4|}}}|<nowiki/>: {{{descr4|}}}}} | ||
}}<!-- | }}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param5|}}}| | ||
* {{{ | * {{{param5}}}{{#if:{{{descr5|}}}|<nowiki/>: {{{descr5|}}}}} | ||
}}<!-- | }}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param6|}}}| | ||
* {{{ | * {{{param6}}}{{#if:{{{descr6|}}}|<nowiki/>: {{{descr6|}}}}} | ||
}}<!-- | }}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param7|}}}| | ||
* {{{ | * {{{param7}}}{{#if:{{{descr7|}}}|<nowiki/>: {{{descr7|}}}}} | ||
}}<!-- | }}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param8|}}}| | ||
* {{{ | * {{{param8}}}{{#if:{{{descr8|}}}|<nowiki/>: {{{descr8|}}}}} | ||
}}<!-- | }}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param9|}}}| | ||
* {{{ | * {{{param9}}}{{#if:{{{descr9|}}}|<nowiki/>: {{{descr9|}}}}} | ||
}}<!-- | }}<!-- | ||
-->{{#if:{{{ | -->{{#if:{{{param10|}}}| | ||
* {{{ | * {{{param10}}}{{#if:{{{descr10|}}}|<nowiki/>: {{{descr10|}}}}} | ||
}} | }} | ||
{{#if:{{{example1|}}}{{{example2|}}}{{{example3|}}}{{{example4|}}}{{{example5|}}} | {{#if:{{{example1|}}}{{{example2|}}}{{{example3|}}}{{{example4|}}}{{{example5|}}} | ||
| | | | ||
{{{!}} | {{{!}} style{{=}}"border-spacing: 1em 0.5em" | ||
{{!}}+ Examples | {{!}}+ Examples | ||
{{!}}- style{{=}}"background-color: #EEE" | {{!}}- style{{=}}"background-color: #EEE" | ||
Line 76: | Line 78: | ||
{{!}} {{{example5|}}} | {{!}} {{{example5|}}} | ||
{{!}} {{{result5|}}} | {{!}} {{{result5|}}} | ||
{{!}}- | |||
}} | |||
{{#if: {{{example6|}}} | |||
| | |||
{{!}} {{{example6|}}} | |||
{{!}} {{{result6|}}} | |||
{{!}}- | |||
}} | |||
{{#if: {{{example7|}}} | |||
| | |||
{{!}} {{{example7|}}} | |||
{{!}} {{{result7|}}} | |||
{{!}}- | |||
}} | |||
{{#if: {{{example8|}}} | |||
| | |||
{{!}} {{{example8|}}} | |||
{{!}} {{{result8|}}} | |||
{{!}}- | |||
}} | |||
{{#if: {{{example9|}}} | |||
| | |||
{{!}} {{{example9|}}} | |||
{{!}} {{{result9|}}} | |||
{{!}}- | |||
}} | |||
{{#if: {{{example10|}}} | |||
| | |||
{{!}} {{{example10|}}} | |||
{{!}} {{{result10|}}} | |||
{{!}}- | {{!}}- | ||
}} | }} | ||
Line 81: | Line 113: | ||
}} | }} | ||
{{#ifeq:{{uc:{{FULLPAGENAME}}}} | DOC/TEMPLATE | {{#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: | ||
| | <include<nowiki/>only>'''*template's code*'''</include<nowiki/>only><no<nowiki/>include>{{<nowiki/>'''Doc/Template''' | ||
}} | | ... | ||
</includeonly><noinclude> | }} | ||
Documents and categorises a [[:Category:Templates|Template]]. | </no<nowiki/>include> | ||
== Usage == | == Usage == | ||
{{<nowiki/>Doc/Template|'''''name'''''|'''''descr'''''|''''' | {{<nowiki/>Doc/Template|'''''name'''''|'''''descr'''''|'''''param''#'''|'''''descr''#'''|'''''example''#'''|'''''result''#'''|'''''historical'''''}} | ||
* name: (Optional, default | * name: (Optional, default {{hl|{{<nowiki/>PAGENAME}}}}) template name | ||
* descr: template text description | * descr: template text description | ||
* | * param#: (# = number range 1..10) parameter name | ||
* descr#: (# = number range 1..10) | * descr#: (# = number range 1..10) parameter description | ||
* example#: (# = number range 1.. | * 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.. | * 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" | ||
|+ Examples | |+ Examples | ||
|- style="background-color: #EEE" | |||
! Code | ! Code | ||
! Result | ! Result | ||
Line 109: | Line 145: | ||
| name = MyTemplate | | name = MyTemplate | ||
| descr = Template description | | descr = Template description | ||
| | | param1 = parameter1 | ||
| descr1 = this is the first | | descr1 = this is the first parameter | ||
| | | param2 = parameter2 | ||
| descr2 = (Optional) this is the second | | descr2 = (Optional) this is the second parameter | ||
}}</pre> | }}</pre> | ||
Line 118: | Line 154: | ||
| name = MyTemplate | | name = MyTemplate | ||
| descr = Template description | | descr = Template description | ||
| | | param1 = parameter1 | ||
| descr1 = this is the first | | descr1 = this is the first parameter | ||
| | | param2 = parameter2 | ||
| descr2 = (Optional) this is the second | | descr2 = (Optional) this is the second parameter | ||
}} | }} | ||
Line 129: | Line 165: | ||
| name = MyTemplate | | name = MyTemplate | ||
| descr = Template description | | descr = Template description | ||
| | | param1 = parameter1 | ||
| descr1 = this is the first | | descr1 = this is the first parameter | ||
| | | param2 = parameter2 | ||
| descr2 = (Optional) this is the second | | descr2 = (Optional) this is the second parameter | ||
| example1 = <nowiki>{{MyTemplate|Hello there!}}</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 140: | Line 177: | ||
| name = MyTemplate | | name = MyTemplate | ||
| descr = Template description | | descr = Template description | ||
| | | param1 = parameter1 | ||
| descr1 = this is the first | | descr1 = this is the first parameter | ||
| | | param2 = parameter2 | ||
| descr2 = (Optional) this is the second | | descr2 = (Optional) this is the second parameter | ||
| example1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki> | | example1 = <nowiki>{{MyTemplate|Hello there!}}</nowiki> | ||
| result1 = | | result1 = {{hl|Hello there!}} | ||
| historical = y | |||
}} | }} | ||
Latest revision as of 11:54, 26 April 2023
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.
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}}
| ||||
{{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 }} |
Template description
This template is used on these pages. Usage{{MyTemplate|parameter1|parameter2}}
|