Iron Chariots Wiki:Templates
(use {t}) |
(→Transclusion of content from other namespaces: use {t} and {l}) |
||
| Line 23: | Line 23: | ||
If you want to insert the contents of an article in the "[[Project:Namespaces|main namespace]]" into another page (this should rarely be done in practice), add a colon immediately after the opening double-braces: | If you want to insert the contents of an article in the "[[Project:Namespaces|main namespace]]" into another page (this should rarely be done in practice), add a colon immediately after the opening double-braces: | ||
| − | * | + | * {{l|:List of atheist websites}} would link to [[List of atheist websites]] |
| − | * | + | * {{t|:List of atheist websites}} would insert the contents of [[List of atheist websites]], '''not''' [[Template:List of atheist websites]] |
'''''Please note:''''' ''Although this feature exists, it probably shouldn't be used in articles on this wiki.'' | '''''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 [[Project:Namespaces|namespace prefix]], then the contents of ''that'' page will be transcluded instead of a page in the '''Template:''' namespace: | If the text in braces starts with a [[Project:Namespaces|namespace prefix]], then the contents of ''that'' page will be transcluded instead of a page in the '''Template:''' namespace: | ||
| − | * | + | * {{l|Project:Interwiki map (custom)}} links to [[Project:Interwiki map|our custom interwiki map]] |
| − | * | + | * {{t|Project:Interwiki map (custom)}} inserts our custom interwiki map into a page (this is done on the page [[Project:Interwiki map]], for example) |
See [[WikimediaMeta:Help:Template]] for more (much, much more) information. | See [[WikimediaMeta:Help:Template]] for more (much, much more) information. | ||
Revision as of 02:19, 11 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:
- {{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:
- [[Stub]] links to the "article" Stub, which itself is a redirect to Category:Stubs
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:
- [[:List of atheist websites]] would link to List of atheist websites
- {{:List of atheist websites}} would insert the contents of List of atheist websites, not Template:List of atheist websites
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:
- [[Project:Interwiki map (custom)]] links to our custom interwiki map
- {{Project:Interwiki map (custom)}} inserts our custom interwiki map into a page (this is done on the page Project:Interwiki map, for example)
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}}
|
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 |
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}}
|
none |
| Template:Wikipedia | Provides prominent link (in a right-floated box) to an article in Wikipedia. |
{{wikipedia}}
|
none |
| Template:Wiktionary | Provides prominent link (in a right-floated box) to an entry in Wiktonary. |
{{wiktionary}}
|
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}}
|
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...}} |
no category |
| Template:Comment-box1 | Formats comments in centered box. |
{{comment-box1|parameters...}} |
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:]] |