Locked
Halopedia

Help:Templates: Difference between revisions

From Halopedia, the Halo wiki

(specify the type of brackets needed)
m (Bot: Automated text replacement (-^ +{{Status|Halopedia}}\n))
 
(43 intermediate revisions by 23 users not shown)
Line 1: Line 1:
A '''template''' on Halopedia is a preset chunk of coding used on Halopedia that denotes a page's certain attrbute. What does that mean? For example, if an article is poorly written in terms of grammar, the template known as <nowiki>{{Grammar}}</nowiki> (see below) can be inserted into the page of the page. When <nowiki>{{Grammar}}</nowiki> is inserted into the top of the grammar-proofreading-needing article, when the page is saved, the following will show up:
{{Status|Halopedia}}
{{Grammar}}
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.


When Halopedia editors come across this page, they should try to edit 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.
==Example==
The template <nowiki>{{Flood}}</nowiki> 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.


To insert a template, you'll have to find or create a template. All used templates are displayed below, and help can be recieved in order to create a template. The code that inserts a template into an article is always between double curly brackets - <nowiki>{{Insert Template Name Here}}</nowiki>. However, if you wanted to see the original template to edit it, you have to type in <nowiki>[[Template: Template Name Here]]</nowiki> into the search box.
{{Flood}}


----
==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.


For '''leaving messages on talk pages''' - [[Template:TalkAddNewMsg]], displays as {{TalkAddNewMsg}} when <nowiki>{{TalkAddNewMsg}}</nowiki> is added to the top of a talk page
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.


----
==To insert a template==
To insert a template,  all templates are displayed [[:Category:Templates|on this page]]. The code that inserts a template into an article is always between double curly brackets: <nowiki>{{Insert Template Name Here}}</nowiki>. Example: <nowiki>{{Flood}}</nowiki>


For '''unsigned comments''' - [[Template:Unsigned]], displays as {{Unsigned|Enter Unsigned Person's Name Here}} when <nowiki>{{Unsigned|Enter Unsigned Person's Name Here}}</nowiki> is added behind an unsigned comment
==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.


----
==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.


For '''overall cleanup''' - [[Template:Cleanup]], displays as {{Cleanup}} when <nowiki>{{Cleanup}}</nowiki> is added at the top of a page that needs overall cleanup - errors in grammar, material, introduction, or other.
==Advanced templates==
Templates can also be custom built for each page that they're used. A good example is a template where every time a template is used, it adds who added it, when, and why. A template can do this by asking for those three "parameters" or values from the template.


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


For '''grammar cleanup''' - [[Template:Grammar]], displays as {{Grammar}} when <nowiki>{{Grammar}}</nowiki> is added at the top of a page that specifically needs grammar proofreading
Here is some of the code from an outdated template. See how the <nowiki>{{{#}}}</nowiki>'s are placed where the parameters are supposed to go:


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


For '''factual content cleanup''' - [[Template:FactOrFiction]], displays as {{FactOrFiction}} when <nowiki>{{FactOrFiction}}</nowiki> is added at the top of a page that specifically needs fact-checking
On {{{1}}} {{{2}}} had issues with this article, '''{{PAGENAME}}'''. 
This article contains '''disputed content''' and may be fanfiction
or a non-canon hoax.


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


For an '''exceptional article''' - [[Template:ExceptionalArticle]], displays as {{ExceptionalArticle}} when <nowiki>{{ExceptionalArticle}}</nowiki> is added at the top of a page that is exceptionally written
Please add where this subject is mentioned in the
Halo Universe and add references using the below format:
</pre>


----
===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 an article '''stub''' - [[Template:Stub]], displays as {{stub}} when <nowiki>{{stub}}</nowiki> is added at the bottom of a short insufficient page
For the "Infobox xbox live settings" template you insert this code and then fill in the appropriate data.
<pre>
{{Infobox xbox live settings
|name =
|image =
|caption =
|ranked =
|minimumPlayers =
|maximumPlayers =
|teamCount =
|maximumTeamImbalance =
|minimumPartySize =
|maximumPartySize =
|bigPartyRestrictions =
|minimumBigPartySize =
|maximumBigPartySize =
|bigPartyImbalance =
}}
</pre>


====Sample====
Here is a sample using the game type called "Team Snipers". So first we add the code and the values like this:
<pre>
{{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
}}
</pre>


[[Category: Help]]
==See also==
*[[:Category:Templates|List of Templates]]
 
{{Halopedia HAGP}}
[[Category:Help]]

Latest revision as of 13:13, March 18, 2022

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.

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.

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.

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}}. Example: {{Flood}}

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.

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.

Advanced templates

Templates can also be custom built for each page that they're used. A good example is a template where every time a template is used, it adds who added it, when, and why. A template can do this by asking for those three "parameters" or values from the template.

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 an outdated template. See how the {{{#}}}'s 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:

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 =
}}

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
}}

See also