Changes

Jump to navigation Jump to search
Line 27: Line 27:  
== Writing templates ==
 
== Writing templates ==
 
It is not the purpose of this page to describe the various ways to write templates.  See the [http://meta.wikimedia.org/wiki/Help:Template template manual at MediaWiki].
 
It is not the purpose of this page to describe the various ways to write templates.  See the [http://meta.wikimedia.org/wiki/Help:Template template manual at MediaWiki].
 +
===Creating parameters for templates===
 +
==Making templates==
 +
<nowiki>{{{1}}}</nowiki> creates a parameter for a template
 +
 +
<nowiki>{{{1|car}}}</nowiki> creates a parameter for a template whose default is car
 +
 +
<nowiki>{{{myage}}}</nowiki> creates a parameter named myage for a template
 +
 +
<nowiki>{{{myage|car}}}</nowiki> creates a parameter named myage for a template whose default is car
 +
 +
 +
named parameters for example <nowiki>{{myage}}</nowiki> versus <nowiki> {{{1}}} or {{{2}}} or {{{3}}}</nowiki> do not have to be put in any particular  order
 +
 +
 +
for example let us say there is a template called Template:User age, that looks like this, <nowiki>{{{1}}} is my age</nowiki>
 +
 +
you would put <nowiki>{{User age|12}}</nowiki> for the template to display, 12 is my age
 +
 +
 +
another example let us say there is a template called Template:User age, that looks like this, <nowiki>{{{1}}} is my age, I was born in the month, {{{2}}}</nowiki>
 +
 +
you would put <nowiki>{{User age|12|December}}</nowiki> for the template to display, 12 is my age I was born in the month December
 +
 +
 +
another example let us say there is a template called Template:User age, that looks like this, <nowiki>{{{myage}}} is my age</nowiki>
 +
 +
you would put <nowiki>{{User age|myage=19}}</nowiki> for the template to display, 19 is my age
 +
 +
 +
another example let us say there is a template called Template:User age, that looks like this, <nowiki>{{{myage}}} is my age, I was born in the month, {{{mymonth}}}</nowiki>
 +
 +
you would put <nowiki>{{User age|myage=19|my month=January}}</nowiki> for the template to display, 19 is my age, I was born in the month, January    you also could put <nowiki>{{User age|my month=January|myage=19}}</nowiki> for the same result
    
== Documenting templates ==
 
== Documenting templates ==
8,728

edits

Navigation menu