Anonymous

Help:Templates: Difference between revisions

From OS-Tan Collections Wiki
→‎Using a template: fixing markup and removing links to nonexistent template
(→‎Using a template: fixing markup and removing links to nonexistent template)
Line 7: Line 7:
==Using a template==
==Using a template==
Templates are wiki pages which can be used in other pages in three ways:
Templates are wiki pages which can be used in other pages in three ways:
:codenowiki{{Name}}/nowiki/code includes the current content of the page nowiki[[Template:Name]]/nowiki.  
* <nowiki><code>{{Navbox}}</code></nowiki> includes the current content of the page <nowiki>[[Template:Navbox]]</nowiki>.  
:codenowiki{{subst:Name}}/nowiki/code inserts the content of the page nowiki[[Template:Name]]/nowiki when you save your text.  
* <nowiki><code>{{subst:Navbox}}</code></nowiki> inserts the content of the page <nowiki>[[Template:Navbox]]</nowiki> when you save your text.  
:codenowiki{{msgnw:Name}}/nowiki/code includes the template in raw wiki syntax, like codenowikilt;nowikigt;/nowiki/code does
* <nowiki><code>{{msgnw:Navbox}}</code></nowiki> includes the template in raw wiki syntax, like <nowiki><nowiki></nowiki> does.


==Using parameters in templates==
==Using parameters in templates==
Line 27: Line 27:
|{{Hl2}}|'''You get'''
|{{Hl2}}|'''You get'''
|-
|-
|codenowiki{{Thankyou|all|~~~}}/nowiki/code
|codenowiki{{Thankyou|all|[[User:Halian|—'''Hâlian''']] ([[User talk:Halian|<sup>T</sup>]]⁄[[Special:Contributions/Halian|<sub>C</sub>]])}}/nowiki/code
|
|
{{Thankyou|all|[[User:Someuser|Someuser]]}}
{{Thankyou|all|[[User:Someuser|Someuser]]}}
Line 45: Line 45:
|prenowiki{{Thankyou
|prenowiki{{Thankyou
|reason=all
|reason=all
|signature=~~~}}/nowiki/pre
|signature=[[User:Halian|—'''Hâlian''']] ([[User talk:Halian|<sup>T</sup>]]⁄[[Special:Contributions/Halian|<sub>C</sub>]])}}/nowiki/pre
|
|
{{Thankyou|reason=all|signature=[[User:Kiso|Kiso]]}}
{{Thankyou|reason=all|signature=[[User:Kiso|Kiso]]}}
Line 54: Line 54:
'''Example:''' you want a little thank you note you can put other users on their talk page with a reason and your signature. In the [[Template:Thankyou]] you enter your text.
'''Example:''' you want a little thank you note you can put other users on their talk page with a reason and your signature. In the [[Template:Thankyou]] you enter your text.


When using the template on a page, you fill in the parameter values, separated by a pipe char (|): codenowiki{{Thankyou|all|~~~}}/nowiki/code or - if you have used named parameters  codenowiki{{Thankyou|reason=all|signature=~~~}}/nowiki/code. The advantage of using named parameters in your template is that they are flexible in order. It also makes the template easier to understand if you have many parameters. If you want to change the order of numbered parameters, you have to mention them explicitly: codenowiki{{Thankyou|2=~~~|1=all}}/nowiki/code.
When using the template on a page, you fill in the parameter values, separated by a pipe char (|): codenowiki{{Thankyou|all|[[User:Halian|—'''Hâlian''']] ([[User talk:Halian|<sup>T</sup>]]⁄[[Special:Contributions/Halian|<sub>C</sub>]])}}/nowiki/code or - if you have used named parameters  codenowiki{{Thankyou|reason=all|signature=[[User:Halian|—'''Hâlian''']] ([[User talk:Halian|<sup>T</sup>]]⁄[[Special:Contributions/Halian|<sub>C</sub>]])}}/nowiki/code. The advantage of using named parameters in your template is that they are flexible in order. It also makes the template easier to understand if you have many parameters. If you want to change the order of numbered parameters, you have to mention them explicitly: codenowiki{{Thankyou|2=[[User:Halian|—'''Hâlian''']] ([[User talk:Halian|<sup>T</sup>]]⁄[[Special:Contributions/Halian|<sub>C</sub>]])|1=all}}/nowiki/code.


==Control template inclusion==
==Control template inclusion==