Help:Templates: Difference between revisions

no edit summary
m (Text replacement - "{{Games}}" to "{{Destiny series}}")
No edit summary
Line 1: Line 1:
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.
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.


==More Uses==
==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.
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.
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==
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>{{Destiny series}}</nowiki>
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>{{Destiny series}}</nowiki>


==Creating a Template==
==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.
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==
==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".
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".


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


Line 34: Line 34:
</pre>
</pre>


===Naming the Parameters===
===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 ''Game Infobox'' template:
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 ''Game infobox'' template:


For the "Game Infobox" template you insert this code and then fill in the appropriate data. See [[Template:Game Infobox]] to view the source code.
For the "Game infobox" template you insert this code and then fill in the appropriate data. See [[Template:Game infobox]] to view the source code.
<pre>
<pre>
{{Game Infobox
{{Game infobox
|name=
|name=
|image=
|image=
Line 56: Line 56:


{{Helplist}}
{{Helplist}}
[[Category:Help|Templates]]
[[Category:Help|Templates]]