Help:Contents/Editing The Aquarium Wiki/Intro To Templates

From The Aquarium Wiki
Jump to: navigation, search

Templates are an integral part of the Wiki process. They allow our more senior editors to quickly and efficiently manage the layout of the wiki. We ask that all members who submit articles which fall under the category of a template article, to do so.

Below is a quick intro to how templates work. for the duration of this article, we will use the standard Fish Profile as an example.

The Back End[edit source]

(Only senior editors need to know this)
Templates are created using a wiki programming language designed to display information based on flags sent by an article. You can see a demo here [the Fish Profile template code] please only edit if you are familiar with the methods used. All other edits will be rolled back.

How to use a Template[edit source]

A list of all standard templates used for articles can be found under the Category:Standard Templates article.

'<<<<' signifies a comment about that line, do not include it in an article.

Basic Usage[edit source]

In order to use a template in your article, you must include the template name within {{ }}


{{Fish Profile 
}}                  

See this example in action

The above code will create an empty box because we have not told it what to fill the box with yet. It is possible to define variables for each template and they will be displayed as you include them. Variables which are not-included will not be shown (depending on which template you chose).

Variables[edit source]

In the next example we will add an image, title ,caption, and species name to the template.


{{Fish Profile                               
 |name = Coolio Fish                         
 |image = No_Image.png                       
 |caption = Coolio fish swiming up a river   
 |species = [[Cooliest Pesca]]                
}}                                           

See this example in action

In the above example the | character is used to tell the template engine we are about to define a variable. The following word (no space) is the variable name, followed by an equals sign with the variable's value. Wiki code is allowed in the variables' value.

You 'cannot' just add a variable as the template will not know what to do with it. Complete documentation on what variables are understood can be found at Category:Standard Templates for example:


{{Fish Profile                               
 |name = Coolio Fish                         
 |image = No_Image.png                       
 |caption = Coolio fish swiming up a river   
 |species = [[Cooliest Pesca]]      
 |hair_color = Brown          
}}                                           

See this example in action

This will not throw an error, however because hair colour is not a recognized variable it will not be displayed.

If you have suggestions about a variable to add, please post it on the Discussion tab (at the top) on the page of the Standard Profile which it is used in.