Recent changes Random page
GAMING
Gaming
 
WoWWiki
Diablo Wiki
Fallout-The Vault
Grand Theft Wiki
Halopedia
StarCraft Wiki
FFXIclopedia
Resident Evil Wiki
See more...

Help:Templates

From Halopedia, the Halo Wiki

Jump to: navigation, search

A template is a pre-set piece of text that can be added to a page without having to retype the same text over and over again. This presents an advantage as you only have to change the text on one page and the change will be reflected on every page that contains the template.

Contents

[edit] Example

The template {{Flood}} as shown below can be added to every single page that talks about the Flood. This allows the user to jump to other Flood Forms and if another Flood form is discovered then only one file, the Flood template file, needs to be edited.


Known Flood Forms
Feral Forms Infection FormCombat FormCarrier Form
Pure Forms Stalker FormRanged FormTank Form
Advanced Forms Proto-GravemindGravemind
Uncategorized Forms Prophet FormFlood Growth PodsFlood Dispersal PodPortaFlood HiveFlood SporesFlood LauncherFlood SwarmsFlood DenBomber FormThrasher Form
Cut Forms JuggernautShielded Carrier FormInfector FormTransport FormStealth Form

[edit] More Uses

Templates also have other uses; creating awards that are given to exceptional users, welcoming a user to the community, or sorting information in an article.

When editors come across this page, they should try to fix the article and look for grammar errors. After the person who placed the template is satisfied that the article has been cleaned up, then the line of code will be removed.

[edit] To Insert a Template

To insert a template, all templates are displayed on this page. The code that inserts a template into an article is always between double curly brackets - {{Insert Template Name Here}}. ex. {{Flood}}

[edit] Creating a Template

If you feel a need for a template and want to create your own to add to pages then you can create your own. First search that your idea for a template doesn't already exist. Then type "Template: Template Name Here into the search box. The Search should come up empty with an option to create your own article with the search phrase. Create the Template, save and then add the template by using instructions above.

[edit] Editing a Template

Before you edit a template be wary of your changes as they will be reflected across many, in the some case dozens of pages. To edit a Template you just type in the search box "Template:Template Name Here". For example to edit the Flood Template type "Template:Flood" in the search box.

[edit] Advanced Templates

Templates can also be custom built for each page that they're used. A good example of this is the {{FactOrFictionTalk}} Template. Every time this template is used it adds who added it, when and why. The template does this by asking for those three "parameters" or values from the template. So for example by typing in this information (Seperated by the | horizontal bar):

{{FactOrFictionTalk|05:08, 16 November 2006 (UTC)|[[User:Esemono|Esemono]]|This is just an example.}}

We get this:

"Our Prophets are false! Open your eyes, my brothers! They would use the faith of our forefathers to bring ruin to us all!"

On 05:08, 16 November 2006 (UTC), Esemono had issues with this article, Templates. This article contains disputed content and may be fanfiction or a noncanon hoax.

This is just an example.

Please add where this subject is mentioned in the Halo Universe and add references using the below format:


Add Ref like this:

<ref>[[Halo: The Fall of Reach]], page 19</ref>

Then at the bottom of the page put this:

{{Ref}}


To see an example go see UNSC Magellan


[edit] Make your own

You can get your template to ask for information simply by adding this code {{{1}}} in your template. By adding the {{{1}}} the template knows to put whatever is passed first in place of the {{{1}}}. To add other values/variables/parameters just increase the number i.e. {{{2}}}{{{3}}

Here is some of the code from the the Template:FactOrFictionTalk page . See how the {{{1}}} are placed where the parameters are supposed to go:

''"Our Prophets are false! Open your eyes, my brothers! 
They would use the faith of our forefathers to bring ruin 
to us all!"''

On {{{1}}} {{{2}}} had issues with this article, '''{{PAGENAME}}'''.  
This article contains '''disputed content''' and may be fanfiction 
or a non-canon hoax.

'''{{{3}}}'''

Please add where this subject is mentioned in the 
Halo Universe and add references using the below format:


[edit] Naming the Parameters

You can take this a step further by instead of using a number you name the variable. A good example of a template that uses this method is the Infobox xbox live settings template:

For the "Infobox xbox live settings" template you insert this code and then fill in the appropriate data.

{{Infobox xbox live settings
|name=
|image=
|caption=
|ranked=
|minimumPlayers=
|maximumPlayers=
|teamCount=
|maximumTeamImbalance=
|minimumPartySize=
|maximumPartySize=
|bigPartyRestrictions=
|minimumBigPartySize=
|maximumBigPartySize=
|bigPartyImbalance=
}}

[edit] Sample

Here is a sample using the game type called "Team Snipers". So first we add the code and the values like this:

{{Infobox xbox live settings
|name=Team Snipers Xbox Live Settings
|image=
|caption=
|ranked=Yes
|minimumPlayers=6
|maximumPlayers=8
|teamCount=2
|maximumTeamImbalance=-
|minimumPartySize=1
|maximumPartySize=4
|bigPartyRestrictions=Yes
|minimumBigPartySize=3
|maximumBigPartySize=4
|bigPartyImbalance=0
}}
Team Snipers Xbox Live Settings

Ranked: Yes
Minimum Players: 6
Maximum Players: 8
Team Count: 2
Maximum Team Imbalance: -
Minimum Party Size: 1
Maximum Party Size: 4
Big Party Restrictions: Yes
Minimum Big Party Size: 3
Maximum Big Party Size: 4
Big Party Imbalance: 0


Then when we save and reload the page it displays this:

[edit] See Also


Halopedia Help Pages
DisambiguationsEditingImagesLinksManual of StyleParodiesReferencesRollback RightsShortcutsSourcesSignaturesTablesTemplatesUserboxesWalkthroughsYouTube

A template is a special type of page that has been designed so its content can be included in one or more other pages. Since a given template can be included in many pages, templates can help reduce duplication and promote a uniform style between pages.

Templates are usually located in the Template namespace, which means any page name beginning with Template:, such as Template:Name. However, any page can act as a template.

Contents

Referencing templates

Transcluded template

The content of a template can be added to a page by referencing it using the wiki markup: {{templatename}}. This references the template and includes its output at the point of insertion. Articles will be updated automatically when referenced templates are changed. A page that references templates cannot be edited to change the content of a referenced template, although a list of referenced templates will be displayed at the bottom of the page for convenience while editing it.

Substituting templates

Substituted template

A different way to use a template is to substitute its content into a page. This is done by inserting subst: immediately after the opening braces: {{subst:templatename}}. Once the page is saved, the link to the template is removed and the template output is substituted in its place and can be further edited. Any updates to the template will not affect the content that was substituted into the page.

Benefits of templates

Templates are used to add recurring messages to pages in a consistent way, to add boilerplate messages, to create infoboxes and navigational boxes, and to provide cross-language portability of texts.

Templates can also make it much easier for new and casual editors to use advanced designs, features and extensions by hiding confusing code.

Creating a template

In short, create the text you want to have copied onto the target pages on a page in the Template namespace. Creating Template:Templatename will allow users to insert {{templatename}} into a page to display your text.

See Help:Creating templates for details.

For an overview, see the quick guide to templates on Wikimedia's Meta-Wiki.

Creating an advanced template

To learn how to change the output of the template based on what the user inputs, see Help:Template parameters and Help:Parser functions.

Updating and adding standard templates

Wikia's Starter Pages and Templates wikis occasionally improve some of their documentation as well as adding new templates specifically designed for Wikia sites, and are therefore worth checking from time to time. For sites created before about December 2008, the Starter Pages wiki should be compared and ideally used for upgrading to its standard documentation system similar to that introduced in Wikipedia.