Help:Templates: Difference between revisions
imported>Zombie Man (historical) (Updating - moved and updated info on Templates to this page. Creating hierarchy of top level help > this templates page > useful templates.) |
imported>Zombie Man (historical) (+Categorizing Templates) |
||
Line 50: | Line 50: | ||
* [http://www.mediawiki.org/wiki/Help:ParserFunctions Functions used in template math or logic expressions] | * [http://www.mediawiki.org/wiki/Help:ParserFunctions Functions used in template math or logic expressions] | ||
* [http://www.mediawiki.org/wiki/Help:Magic_words Special variable, i.e. ''magic words'' used in templates or articles ] | * [http://www.mediawiki.org/wiki/Help:Magic_words Special variable, i.e. ''magic words'' used in templates or articles ] | ||
== Categorizing Templates == | |||
Templates used on Paragon Wiki are categorized in a hierarchy tree beginning at [[:Category: Templates]] | |||
=== Template Category Coding === | |||
<div style="margin: 1em 0ex;"> | |||
* Use <code><noinclude>[[Category:{{PAGENAME}}|{{PAGENAME}}]]</noinclude></code>. The "<noinclude>" tags are necessary because without them, you end up categorizing all pages using the template in the template category! Please also note the <tt style="border-bottom: 1px dotted; cursor: help;" title="Makes it sort on the actual template name rather than 'T' as in 'Template:'."><nowiki>|{{PAGENAME}}</nowiki></tt>. | |||
</div><div style="margin: 1em 0ex;"> | |||
* If your template is meant to be '''used in-line''', make sure that there are '''no line feeds''' after <tt></noinclude></tt>. If there are, it may work in flowing text, but it will misbehave in bullet lists. You can have as many line feeds as you like ''between'' the noinclude tags though: | |||
<noinclude>[[Category:{{PAGENAME}}|{{PAGENAME}}]]<br /> | |||
</noinclude>''Text or graphic that is meant to be used in-line | |||
</div> | |||
* Remember that a template can be put in multiple categories if it belongs to them all! |
Revision as of 01:32, 18 February 2010
Overview
Standardized formatting across Paragon Wiki is maintained by the use of sample markup language and templates.
- Main article: Help:Contents
Sample markup language
Sample markup language is the use of a simple cut-and-paste of formatting code from one page into another and then adding or changing the content to fit the article. This can be done from a blank sample form or by cutting-and-pasting from an existing article.
An example of a blank form is that used for creating a new page for a contact which can be found here: Sample contact form.
Templates
Templates are specialized pages that define a specific type of formatting style. Templates are created in the Template: namespace. Editors can then call that template into a page and apply it to their text to make that text take on that pre-defined formatting. Templates are called with the double curly brackets {{ }} .
For example, on Paragon Wiki there are templates for colored fonts. The template for making text red is {{red|SampleText}} which would appear on a page as SampleText.
Templates also allow information that is duplicated in several pages to be located and edited in one place. For example, the mission Talk to David Wincott can come from just about any contact, and rather than type that information over and over, it has been created in one place, Template:Mission Hollows, and can then be inserted into any contact with the text, {{Mission Hollows}}.
Templates can also accept parameters, details which change from use to use. An example of this is the Power Template. This simple template takes four parameters, and formats the information into the power entry which is used on most of the enemy pages. Since the format is kept in one place, if, in the future, and new format is decided upon, rather than go through all the enemy pages and redoing their powers, one change to the power template will make those changes in the entire wiki.
Available templates and sample markup language
Samples
- Contact Template to use when creating a new article about a contact
- Preloaded Images such as powers icons and such. Before uploading an image, please read.
Templates
- Useful Templates can help formatting various articles.
- Mission Templates are templates covering common missions, such as story arcs, zone contact intros (such as David Wincott), and security chief intros. These missions can apply to multiple contacts. They have been templated for easy insertion and to avoid errors in duplication.
- Contact Templates are templates that can be used to duplicate new contact introductions among contacts.
- Userboxes are templates that can be placed on your userpage to indicate your interests.
Creating and Editing Templates
Since a change in a Template can possibly affect hundreds of pages, this means that Templates should be edited with great care. Templates are usually created with a mixture of html and wikipedia markup language. Editors who are unsure how to create a template or need help editing one should consult with other editors and administrators on the forums in the Formatting and Standardization Forum.
Editors can see how a Template is formatted by going to the Template:TemplateName page. The creator of the Template may have created an explanation of how the Template is coded; if not, then click on the edit tab to see the formatting language.
- Wikimedia's help page on templates
- Functions used in template math or logic expressions
- Special variable, i.e. magic words used in templates or articles
Categorizing Templates
Templates used on Paragon Wiki are categorized in a hierarchy tree beginning at Category: Templates
Template Category Coding
- Use
<noinclude>[[Category:Templates|Templates]]</noinclude>
. The "<noinclude>" tags are necessary because without them, you end up categorizing all pages using the template in the template category! Please also note the |{{PAGENAME}}.
- If your template is meant to be used in-line, make sure that there are no line feeds after </noinclude>. If there are, it may work in flowing text, but it will misbehave in bullet lists. You can have as many line feeds as you like between the noinclude tags though:
<noinclude>[[Category:Templates|Templates]]
</noinclude>Text or graphic that is meant to be used in-line
- Remember that a template can be put in multiple categories if it belongs to them all!