Personal tools

Help:Includes

From Undead Assault II Guide

Jump to: navigation, search


This page deals with advanced topics which can have a large impact on the guide. Please read it carefully and ensure you fully understand it before making any edits.

Overview

Templates and transcludes are used to simplify and accelerate the process of authoring pages, as well as create consistent formatting across pages.

Templates allow you to insert data into a predefined layout, and then include that layout on your page. This layout could include a table or other formatting. The MOS summary table at the top of each MOS page, for instance, is constructed using a template.

Transcludes can be used to include information from one on other pages so it does not have to be retyped or updated multiple times. This is useful for skill information, for instance, which is sometimes exactly the same for different MOSs.

Please note that extra care and planning must be taken when creating templates, as they are hard to change once they are in use.

Templates

Templates are included in other pages by use of {{Template Name}}. Note that this will only apply to templates which have been added to the Template: namespace. (To include other pages, please see the Transcludes section, below.)

Inserting data into templates is accomplished by use of arguments. On the template itself, these arguments take the form of {{{#}}}, while on the page using the template, they are separated using vertical pipes |.

The full code for a template include might look like this:

<nowiki>{{Template Name|Argument 1|Argument 2|Argument 3}}</nowki>

While the template itself might look like this:

<noinclude>Use this template to create a list of three items.</noinclude>

== Three Things ==
*{{{1}}}
*{{{2}}}
*{{{3}}}

<noinclude>[[Category:Templates]]</noinclude>

Templates should be constructed for specific purposes, and are only necessary when something will be repeated across pages, such as the MOS summary table. You must carefully consider the needs of the template and plan it out in advance, as the template will be difficult to change it once it is being used on other pages.

It is a good idea to include usage information, including a skeleton, on each template, using <noinclude> tags. Please see Template:MOS for an example. For additional information on <noinclude> tags, please see the Editing help page.

To learn more about templates, please examine one.

Usage note: Please add <noinclude>[[Category:Templates]]</noinclude> to the bottom of each template so they are easy to access.

Transcludes

Transcluding pages is useful when you have information that is repeated across many pages (such as skills shared by multiple MOSs) that would be tedious to keep updated if any part of that skill changed. Instead of copying the data and having to update multiple pages, you can create a unique page that holds the data, and then transclude that page into each of the relevant articles.

Transcludes are accomplished using {{:Page Name}}. Note the colon : before the page name.

When constructing a page that will be transcluded, you should add Template:Transclude to the top of the page, informing the reader that the page is transcluded and that changes they make will be propagated across multiple pages.