Iron Chariots Wiki:Templates

(Difference between revisions)
Jump to: navigation, search
(sunst:stub)
(oops... screwed up)
Line 7: Line 7:
 
A concrete example:
 
A concrete example:
 
* <tt><nowiki>[[Template:</nowiki>Stub]]</tt> results in the link [[Template:Stub]].
 
* <tt><nowiki>[[Template:</nowiki>Stub]]</tt> results in the link [[Template:Stub]].
* <tt><nowiki>{{subst:Stub}}</nowiki></tt> &mdash; or, equivalently, <tt><nowiki>{{stub}}</nowiki></tt> &mdash; results in the ''contents'' of the "Stub" template being inserted into the current page:
+
* <tt><nowiki>{{Stub}}</nowiki></tt> &mdash; or, equivalently, <tt><nowiki>{{stub}}</nowiki></tt> &mdash; results in the ''contents'' of the "Stub" template being inserted into the current page:
*: {{stub}}
+
*: <div class="notice metadata" id="stub" style="clear:both;">''This article is a [[:Category:Stubs|stub]]. You can help out by '''<span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|action=edit}} expanding it]</span>'''.''[[Category:Stubs]]</div>
 
The latter form, by the way, is how you can mark extremely short articles ("stubs") that need the attention of other editors.
 
The latter form, by the way, is how you can mark extremely short articles ("stubs") that need the attention of other editors.
  

Revision as of 13:24, 6 December 2006

Templates are reusable portions of text and/or wiki code that can be "included" in other pages by using the "double-braces" wiki syntax:

{{Name of template}}

The name of the template can have spaces (you don't have to replace them by _underscores_). The contents of the template is stored in the same-named page in the Template: namespace, which would be linked to using the following "double-square-brackets" syntax:

[[Template:Name of template]]

The two forms differ in that the former results in the substitution of the contents of the template page at that point in the current page (where {{...}} appears), whereas the latter simply links to the page.

A concrete example:

  • [[Template:Stub]] results in the link Template:Stub.
  • {{Stub}} — or, equivalently, {{stub}} — results in the contents of the "Stub" template being inserted into the current page:

The latter form, by the way, is how you can mark extremely short articles ("stubs") that need the attention of other editors.

On the other hand:

Note that [[Stub]] and {{Stub}} have nothing to do with each other.

If you want to insert the contents of an article in the "main namespace" into another page (this should rarely be done in practice), add a colon immediately after the opening double-braces:

Please note: Although this feature exists, it probably shouldn't be used on this wiki.

If the text in braces starts with a namespace prefix, then the contents of that page will be "included" instead of a page in the Template: namespace:

See WikimediaMeta:Help:Template for more (much, much more) information.

Personal tools
Variants
Actions
wiki navigation
IronChariots.Org
Toolbox