From WikiTemp, the GBAtemp wiki
Revision as of 03:03, 14 December 2008 by WB3000 (talk | contribs) (random template)

THISISAWORKING TEMPLATE!!!

Template:PD Help Page aa

Creating a template

aaa

Using a template

aaa

  • {{Name}} 'transcludes' (i.e. includes a copy of) the content of the template (stored in the page [[Template:Name]]) aaa
  • {{subst:Name}}aaa. Note: aaa
  • {{msgnw:Name}}aaa <nowiki> does) aaa

aaa

  • {{Template:Pagename}} includes [[Template:Pagename]]
  • {{Foo:Pagename}} includes [[Foo:Pagename]]
  • {{:Pagename}} includes [[Pagename]]

bbbb

  • {{Foo:Bar}} includes [[Template:Foo:Bar]]

Using parameters in templates

Template with numbered parameters
 
''bbb.'''<br>
<small>for {{{1}}}.<br>
hugs, {{{2}}}</small>
bbbbb bbbbbbb
{{aau|abbb|ace}}

Template:Aab

with named parameters
 
'''A little thank you...'''<br>
<small>for {{{reason}}}.<br>
hugs, {{{signature}}}</small>
You type You get
{{Thankyou
|reason=all your hard work
|signature=Joe}}
Example sunflower image
A little thank you...
for all your hard work.
hugs, Joe
{{{1}}} or named {{{param}}}.  

When using the tem

Yo {{{reason|all your hard work}}} would result in "all your hard work" if no value was provided for the parameter reason.

Control template inclusion

You can control template inclusion by the use of <noinclude> and <includeonly> tags.

Anything between <noinclude> and </noinclude> will be processed and displayed only when the template's page is being viewed directly.

Possible applications are:

  • Categorising templates
  • Interlanguage links to similar templates in other languages
  • Explanatory text about how to use the template

The converse is <includeonly>. Text between <includeonly> and </includeonly> will be processed and displayed only when the page is being included. The obvious application is to add all pages containing a given template to a category, without putting the template itself into that category.


Organizing templates

For example:

<noinclude>
==Usage==
Allows to establish a link to a subject:
{{NameOfTemplate|Term1+Term2+Term3}}
</noinclude>