Difference between revisions of "Help:Templates"

From The Utopian Encyclopedia
Jump to: navigation, search
m
m
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
A template is a page created explicitly for transclusion - the MediaWiki process of including the contents of one page within another page. Any page can be transcluded, but templates are designed specifically for that purpose, usually for repetitive material that might need to show up on any number of Wikimedia articles or pages. They are commonly used for boilerplate messages, designs, standard warnings or notices, infoboxes, and similar content. Templates may contain plain text, wikitext, HTML and/or CSS, or even other templates, and they have some limited programming capacities: customizable values (called parameters), calculation and branchings (using parser functions), and access to wiki-specific variables (magic words), such as dates, times, and page names.
+
{{Help}}
  
To use a template in an article or page, a template tag (always of the form {{template name}}; the name of the template enclosed in doubled curled brackets) is added where you want the template to appear. When a reader wants to view the page, the Wikimedia servers fetch the contents of the template page, make any calculations that need to be made, and then replace the template tag with the newly processed contents of the template before sending the web page on to the reader's browser. From the perspective of a reader, a template looks as though it were written directly into the HTML of the page in question.
+
{{verdana}}A template is a page created explicitly for transclusion - the process of including the contents of one page within another page. Any page can be transcluded, but templates are designed specifically for that purpose, usually for repetitive material that might need to show up on any number of Wikimedia articles or pages.  
  
= Creating, Editing & Using Templates=
+
Templates may contain plain text, wikitext, HTML and/or CSS, or even other templates, and they have some limited programming capacities: customizable values (called parameters), calculation and branchings (using parser functions), and access to wiki-specific variables (magic words), such as dates, times, and page names.
==Creating a New Template==
+
 
 +
== Creating, Editing & Using Templates==
 +
===Creating a New Template===
 
<nowiki>You start a new template in the same way you would start a normal page. The only difference is that its title must be in the form of Template:templatename.
 
<nowiki>You start a new template in the same way you would start a normal page. The only difference is that its title must be in the form of Template:templatename.
  
Once you have made the template, you can add ''{{templatename}}'' to the pages you want to use it on. Every page using this template will get the same boilerplate text, each time a user visits it. When the template is updated, all pages containing the template tag will be automatically updated.</nowiki>
+
Once you have made the template, you can add ''{{templatename}}'' to the pages you want to use it on. Every page using this template will get the same text, each time a user visits it. When the template is updated, all pages containing the template tag will be automatically updated.</nowiki>
 
 
==Editing an Existing Template==
 
<nowiki>If the template you want to edit looks like ''{{foo}}'', you would go to '''Template:foo''' to edit it. To get there, type in the URL to your address bar, search for it, or make a link in the sandbox and click on it.
 
 
 
Once you are there, just click "edit" or "edit this page" and edit it in the same way you would any other page. You can add anything you would add to a normal page, including text, images and other templates. Please be aware that your edit might affect many pages, so be cautious.</nowiki>
 
 
 
  
=List of Templates on UtoWiki=
+
===Editing an Existing Template===
==Tables==
+
<nowiki>If the template you want to edit looks like ''{{Table}}'', you would go to '''Template:Table''' to edit it. To get there, type in the URL to your address bar, or look for it below. Once you are there, just click "edit" and edit it in the same way you would any other page. Please be aware that your edit might affect many pages, so be cautious.</nowiki>
===General===
 
Use <nowiki>||</nowiki> to create a new column. For example, if you want 3 columns, then you would do <nowiki>'''LEFT HEADER''' || '''CENTER HEADER''' || '''RIGHT HEADER''' </nowiki>.
 
*  For 2 columns, your wikitext would look like <nowiki>'''LEFT HEADER''' || '''RIGHT HEADER'''</nowiki>
 
  
 +
===Using an Existing Template===
 +
<nowiki>To use a template in an article or page, a template tag (always of the form {{template name}} is added where you want the template to appear. </nowiki>
  
Use <nowiki>|-</nowiki> to denote the end of a row, and <nowiki>|</nowiki> to start a new row.
 
  
  
===[[Template:Table|Red Table]]===
+
==List of Templates on UtoWiki==
'''Code'''
+
In order to list out all the templates in use on the Utopia Wiki, [[:Category:Templates|Click Here]]
<nowiki> {{Table}}
 
| '''LEFT HEADER''' || '''RIGHT HEADER'''
 
|-
 
| LEFT CELL || RIGHT CELL
 
|-
 
| LEFT CELL2 || RIGHT CELL2
 
|-</nowiki>
 
  |}</nowiki>
 
  
'''Example'''
 
{{Table}}
 
| '''LEFT HEADER''' || '''RIGHT HEADER'''
 
|-
 
| LEFT CELL || RIGHT CELL
 
|-
 
| LEFT CELL2 || RIGHT CELL2
 
|-
 
|}
 
  
===[[Template:Mods|Modifiers Table for Formulas]]===
 
'''Code'''
 
<nowiki> {{Mods}}
 
| Modifier Type || Multiplier if Modifier = true || Multiplier if Modifier = False
 
|-
 
| Modifier Type2 || Multiplier if Modifier2 = true || Multiplier if Modifier2 = False
 
|-
 
|}</nowiki>
 
  
'''Example'''
+
[[Category:Help Pages]]
{{Mods}}
 
| Modifier Type || Multiplier if Modifier = true || Multiplier if Modifier = False
 
|-
 
|}
 

Latest revision as of 16:00, 11 July 2009

This is part of the Utopia WIKI Help Guide Series.

This Page references Utopia Wiki's official guide to Templates. Please use common sense.



A template is a page created explicitly for transclusion - the process of including the contents of one page within another page. Any page can be transcluded, but templates are designed specifically for that purpose, usually for repetitive material that might need to show up on any number of Wikimedia articles or pages.

Templates may contain plain text, wikitext, HTML and/or CSS, or even other templates, and they have some limited programming capacities: customizable values (called parameters), calculation and branchings (using parser functions), and access to wiki-specific variables (magic words), such as dates, times, and page names.

Creating, Editing & Using Templates

Creating a New Template

You start a new template in the same way you would start a normal page. The only difference is that its title must be in the form of Template:templatename. Once you have made the template, you can add ''{{templatename}}'' to the pages you want to use it on. Every page using this template will get the same text, each time a user visits it. When the template is updated, all pages containing the template tag will be automatically updated.

Editing an Existing Template

If the template you want to edit looks like ''{{Table}}'', you would go to '''Template:Table''' to edit it. To get there, type in the URL to your address bar, or look for it below. Once you are there, just click "edit" and edit it in the same way you would any other page. Please be aware that your edit might affect many pages, so be cautious.

Using an Existing Template

To use a template in an article or page, a template tag (always of the form {{template name}} is added where you want the template to appear.


List of Templates on UtoWiki

In order to list out all the templates in use on the Utopia Wiki, Click Here