Iron Chariots Wiki:Templates

(Difference between revisions)
Jump to: navigation, search
(Other templates: add section for informational templates)
(use {t})
Line 1: Line 1:
 
'''Templates''' are reusable portions of text and/or [[WikimediaMeta:Help:Help:Wikitext examples|wiki markup]] that can be "included" in other pages by using the "double-braces" wiki syntax:
 
'''Templates''' are reusable portions of text and/or [[WikimediaMeta:Help:Help:Wikitext examples|wiki markup]] that can be "included" in other pages by using the "double-braces" wiki syntax:
: <tt><nowiki>{{</nowiki>''Name of template''}}</tt>
+
: {{t|''Name of template''}}
 
The name of the template can have spaces (you don't have to replace them by _underscores_); the first letter is case insensitive (it can be capital or lower-case), but subsequent letters are case sensitive.
 
The name of the template can have spaces (you don't have to replace them by _underscores_); the first letter is case insensitive (it can be capital or lower-case), but subsequent letters are case sensitive.
  
Line 12: Line 12:
 
* <tt><nowiki>[[Template:</nowiki>Stub]]</tt> results in the link:
 
* <tt><nowiki>[[Template:</nowiki>Stub]]</tt> results in the link:
 
*: [[Template:Stub]]
 
*: [[Template:Stub]]
* <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:
+
* {{t|Stub}} &mdash; or, equivalently, {{t|stub}} &mdash; results in the ''contents'' of the "Stub" template being inserted into the current page:
 
*: ''This article is a [[:Category:Stubs|stub]]. You can help out by '''<span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|action=edit}} expanding it]</span>'''.''
 
*: ''This article is a [[:Category:Stubs|stub]]. You can help out by '''<span class="plainlinks">[{{fullurl:{{FULLPAGENAME}}|action=edit}} expanding it]</span>'''.''
 
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.
Line 18: Line 18:
 
On the other hand:
 
On the other hand:
 
* <tt><nowiki>[[Stub]]</nowiki></tt> links to the "article" [[Stub]], which itself is a [[WikimediaMeta:Help:Redirect|redirect]] to [[:Category:Stubs]]
 
* <tt><nowiki>[[Stub]]</nowiki></tt> links to the "article" [[Stub]], which itself is a [[WikimediaMeta:Help:Redirect|redirect]] to [[:Category:Stubs]]
Note that <tt><nowiki>[[Stub]]</nowiki></tt> and <tt><nowiki>{{Stub}}</nowiki></tt> have nothing to do with each other.
+
Note that <tt><nowiki>[[Stub]]</nowiki></tt> and {{t|Stub}} have nothing to do with each other.
  
 
== Transclusion of content from other namespaces ==
 
== Transclusion of content from other namespaces ==

Revision as of 18:24, 10 October 2007

Templates are reusable portions of text and/or wiki markup 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 first letter is case insensitive (it can be capital or lower-case), but subsequent letters are case sensitive.

The content 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 (or "transclusion") of the contents of the template page at that point in the current page (where {{...}} appears), whereas the latter simply links to the page.

Contents

Wiki markup for templates

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:
    This article is a stub. You can help out by expanding it.

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.

Transclusion of content from other namespaces

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 in articles on this wiki.

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

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

Lists of templates

The following tables list the templates that are currently in use on this wiki, including brief descriptions and examples of usage.

See also the simple, alphabetical list of templates and Category:Templates.

Maintenance templates

Templates for marking pages in need of attention by other editors or by administrators (except for stubs, templates for which are listed below).

Template name Purpose Usage Category
Template:Delete Mark pages that should be deleted by an administrator.

{{delete}}
{{delete|reason}}

Category:Pages for deletion
Template:Wikify Request that an article be properly formatted with wiki markup, including links to other pages, section headers, etc., as appropriate. {{wikify}} Category:Articles to be wikified
Template:Work in progress Request that an article not be edited for a time because the original author is still working on it. {{Work in progress}} Category:Works in progress

Stub templates

Templates for marking short, underdeveloped articles on different topics that are in need of expansion by individuals familiar with those topics. The main category for stubs is Category:Stubs.

Template name Purpose Usage Category
Template:Apologist-stub Biographical stubs about religious (usually Christian) apologists. {{apologist-stub}} Category:Apologist stubs
Template:Argument-stub Stubs about arguments for or against the existence of God or gods. {{argument-stub}} Category:Argument stubs
Template:Atheist-stub Biographical stubs about atheists. {{atheist-stub}} Category:Atheist stubs
Template:Mythology-stub Stubs about various metaphysical, usually non-religious, topics. {{mythology-stub}} Category:Mythology stubs
Template:Philosophy-stub Stubs about various philosophical topics. {{philosophy-stub}} Category:Philosophy stubs
Template:Religion-stub Stubs about religious topics. {{religion-stub}} Category:Religion stubs
Template:Stub Stubs about all other topics. {{stub}} Category:Stubs

Navigational templates

Templates whose function is to interlink closely related articles.

(Note: Since the purpose is always the same, there is no "Purpose" column in this table. Also, since it's usually not a good idea to "auto-categorize" articles using templates such as these — i.e., by including the Category: link in the template itself — the "Category" column has been replaced by "Main article".)

Template name Usage Main article
Template:Books of the Bible {{Books of the Bible}} Bible
Template:Conversationswithanatheist {{conversationswithanatheist}} Conversations with an atheist
Template:Jackchick {{jackchick}} Jack Chick
Template:Wayofthemaster {{wayofthemaster}} The Way of the Master

External-links templates

Templates whose primary function is linking to external websites (which need not be wikis, actually).

Template name Purpose Usage Category
Template:Bible Link Bible citation to text of passage in King James Version.

{{bible|Book Chapter}}
{{bible|Book Chapter:Verse}}
{{bible|Book Chapter:Range}}
(see Template:Bible for more information)

none
Template:Wikipedia Provides prominent link (in a right-floated box) to an article in Wikipedia.

{{wikipedia}}
{{wikipedia|Article}}
{{wikipedia|Article|Link text}}
(see Template:Wikipedia for more information)

none
Template:Wiktionary Provides prominent link (in a right-floated box) to an entry in Wiktonary.

{{wiktionary}}
{{wiktionary|entry}}
{{wiktionary|entry|link text}}
(see Template:Wiktionary for more information)

none

Utility templates

Templates whose primary function is to aid in constructing other templates.

Template name Purpose Usage Category
Template:If Simple if-then-else functionality.

{{if|test=condition|then=wikitext|else=wikitext}}
(see Template:If for more information)

none

Informational templates

Templates whose primary function is to give the reader information in, or about, an article.

Template name Purpose Usage Category
Template:Quote Formats displayed quotes ("blockquotes") in a consistent manner.

{{quote|text of quotation}}

no category
Template:Cite journal Formats citations of journal articles.

{{cite journal|parameters...}}
(see template)

no category
Template:Comment-box1 Formats comments in centered box.

{{comment-box1|parameters...}}
(see template)

no category
Template:Current event Marks articles related to current events.

{{current event}}

Category:Current events
Template:Disambig Marks disambiguation pages.

{{disambig}}

Category:Disambiguation;
see also Special:Disambiguations

Other templates

Other templates not already listed elsewhere.

Template name Purpose Usage Category
[[Template:]] {{}} [[:Category:]]
Personal tools
Variants
Actions
wiki navigation
IronChariots.Org
Toolbox