Help:Templates

From Crankshaft Coalition Wiki
Jump to: navigation, search
m (Add category)
 
Line 4: Line 4:
 
==Creation==
 
==Creation==
 
Templates are standard wiki pages whose content is designed to be [http://en.wikipedia.org/w/index.php?title=Transclusion transcluded] (embedded) inside other pages. Templates follow a convention that the name is prefixed with "<code>Template:</code>", assigning it to that namespace. Therefore you can [[Help:Starting a new page|create them like any other wiki page]].
 
Templates are standard wiki pages whose content is designed to be [http://en.wikipedia.org/w/index.php?title=Transclusion transcluded] (embedded) inside other pages. Templates follow a convention that the name is prefixed with "<code>Template:</code>", assigning it to that namespace. Therefore you can [[Help:Starting a new page|create them like any other wiki page]].
 +
 +
Below the text that comprises the template, include the following text to have the template appear on the [http://www.crankshaftcoalition.com/wiki/Category:Templates '''Template category'''] page: <nowiki><noinclude>
 +
[[Category:Templates|{{PAGENAME}}]]
 +
</noinclude></nowiki>
 +
 +
===List of templates===
 +
A list of currently used templates can be seen on the [http://www.crankshaftcoalition.com/wiki/Category:Templates '''Template category'''] page.
  
 
==Usage==
 
==Usage==
Line 32: Line 39:
 
'''A little thank you...'''<br />
 
'''A little thank you...'''<br />
 
<small>for {{{1}}}.<br />
 
<small>for {{{1}}}.<br />
from, {{{2}}}</small>
+
hugs, {{{2}}}</small>
 
</nowiki></pre>  
 
</nowiki></pre>  
 
|-
 
|-
Line 38: Line 45:
 
|{{Hl2}}|'''You get'''
 
|{{Hl2}}|'''You get'''
 
|-
 
|-
|<code><nowiki>{{Thankyou|all your hard work|Jon}}</nowiki></code>
+
|<code><nowiki>{{Thankyou|all your hard work|Joe}}</nowiki></code>
 
|
 
|
{{Thankyou|all your hard work|Jon}}
+
{{Thankyou|all your hard work|Joe}}
 
|-
 
|-
 
|{{Hl2}} colspan="2" align="center" |'''with named parameters'''
 
|{{Hl2}} colspan="2" align="center" |'''with named parameters'''
Line 48: Line 55:
 
'''A little thank you...'''<br />
 
'''A little thank you...'''<br />
 
<small>for {{{reason}}}.<br />
 
<small>for {{{reason}}}.<br />
from, {{{signature}}}</small>
+
hugs, {{{signature}}}</small>
 
</nowiki></pre>  
 
</nowiki></pre>  
 
|-
 
|-
Line 56: Line 63:
 
|<pre><nowiki>{{Thankyou
 
|<pre><nowiki>{{Thankyou
 
|reason=all your hard work
 
|reason=all your hard work
|signature=Jon}}</nowiki></pre>
+
|signature=Joe}}</nowiki></pre>
 
|
 
|
{{Thankyou|all your hard work|Jon}}
+
{{Thankyou|all your hard work|Joe}}
 
|}
 
|}
 
</div>
 
</div>
Line 65: Line 72:
 
'''Example:''' You want a little thank you note you can put on the talk page of other users. It will contain a reason and your signature. You could create [[Template:Thankyou]] to enter your text, as in the example in the table.
 
'''Example:''' You want a little thank you note you can put on the talk page of other users. It will contain a reason and your signature. You could create [[Template:Thankyou]] to enter your text, as in the example in the table.
  
When using the template on a page, you fill in the parameter values, separated by a pipe char (|): <code><nowiki>{{Thankyou|all your hard work|Jon}}</nowiki></code>.  For named parameters use "name=value" pairs separated by a pipe char:  <code><nowiki>{{Thankyou|reason=all your hard work|signature=Jon}}</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: <code><nowiki>{{Thankyou|2=Jon|1=all your hard work}}</nowiki></code>.
+
When using the template on a page, you fill in the parameter values, separated by a pipe char (|): <code><nowiki>{{Thankyou|all your hard work|Joe}}</nowiki></code>.  For named parameters use "name=value" pairs separated by a pipe char:  <code><nowiki>{{Thankyou|reason=all your hard work|signature=Joe}}</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: <code><nowiki>{{Thankyou|2=Joe|1=all your hard work}}</nowiki></code>.
  
 
You can also provide default values for parameters, i.e. values that are going to be used if no value is provided for a parameter. For example, <code><nowiki>{{{reason|all your hard work}}}</nowiki></code> would result in ''"all your hard work"'' if no value was provided for the parameter <tt>reason</tt>.
 
You can also provide default values for parameters, i.e. values that are going to be used if no value is provided for a parameter. For example, <code><nowiki>{{{reason|all your hard work}}}</nowiki></code> would result in ''"all your hard work"'' if no value was provided for the parameter <tt>reason</tt>.
Line 111: Line 118:
  
 
[[Category:Help]]
 
[[Category:Help]]
 +
[[Category: Wiki information]]

Latest revision as of 17:10, 18 June 2012

Personal tools
Namespaces
Variants
Actions
Navigation
Categories
Toolbox