Help:Templates
From ELDWiki
| Staff wiki help pages |
|---|
| Main help page |
| Help topics |
|
Getting started |
| Learning more |
Templates are embedded code or menus, which can help you navigate the wiki and incorporate complicated formatting into your pages. Templates are also useful because you can make changes to them in one place and the template is automatically updated on every page where it is used. Templates reside in the "template" namespace. An example of a template is the "help pages" navigation bar you see on the right side of this page.
Using templates
To incorporate a template on a page, find the name of the template, and then place it on the page in double curly brackets:
{{Template name}}
For instance, on this page, the "Help" template to the right has the name of "help" and is placed on the page with the following code:
{{help}}
The "help" template resides at Template:Help. The source code of the template (which you can see by going to the template and clicking "edit") looks in part like this:
{|style="padding:0.3em; float:right; margin-left:15px; border:1px solid #A3B1BF; background:#f5faff; text-align:center;
font-size:95%; line-height:1.5em;"
!style="background:#cee0f2; padding:0.3em; text-align:center;"|Staff wiki help pages
|-
|[[Help:Contents|Main help page]]
Using the template function saves you from having to remember -- and retype -- this complicated table markup every time you want to use the "help" menu on a page. Instead, you can build the template once and then just type {{help}} each time you want to use it.
List of templates
Editing templates
- To start a new template, put it in the template namespace: "Template:Name of my template". Then edit it like any other page.
- You can use any markup you might normally use in templates. Additionally, there are ways of using HTML and special template syntax to create complicated formatting. More information can be found here:
It's easiest to learn how to build templates by looking at other people's. You can see a list of the many template messages used on Wikipedia here. The source code of any of these is viewable by clicking on "edit."
