From SeptemWiki
Revision as of 18:45, 9 April 2016 by Shawn (talk | contribs) (→‎What a Template Does)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Templates are pages which can be included inside other pages by using the {{ }} Wiki syntax.

What a Template Does

In essence, a template is a small piece of Wiki text, tables, or whatever that you want to include repeatedly in other pages.

A template can be as simple as you like; if we create a page called Template:Jerkface and it just contains "Shawn Knight", then every place we put {{Jerkface}} in the wiki, "Shawn Knight" will appear. But then simply by editing Template:Jerkface to say "Alan Caum", every page which uses the template will show Alan's name instead. This allows numerous articles to refer to whoever the current jerkface is, without having to edit them all when that changes; instead, we just edit the template.

Template Syntax

A template is inserted into a page using the syntax:


where TemplateName is the name of the template, and param1 is the name of a parameter given the value A, param2 is a parameter given the value B, and so on.

In the event you wish to make your wiki code more readable, you may insert line breaks between the parameters of a template. So the example at the top of this section could be written:

{{TemplateName |param1=A

Here's a real example of a template being used with a bunch of parameters:

|caption=Actually there is no plaza named Template Demo, that would be a silly name; this is Sideling Hill Plaza.
|name=Template Demo
|direction=Eastbound and Westbound
Template Demo Service Plaza
Sideling Hill Plaza.jpg
Actually there is no plaza named Template Demo, that would be a silly name; this is Sideling Hill Plaza.
Direction Eastbound and Westbound
County Fulton
State Kalmont

And it would generate the info box you see to the right here, with the picture and caption and all that.

In this particular template, we don't need to know the order to put the parameters in, because each parameter has a name.

For some simple templates, only parameter values are specified, not their names; if there are multiple parameters in such a case, they must be given in order. An example is the "main article" template, which takes only one parameter:

{{main|Triparic language}}

And some templates may be so simple they need no parameters at all:


Template Documentation

Here at SeptemWiki, we're trying to ensure that each template is well-documented. When you visit the template's page directly, like Template:PlazaBox, you should see some decent documentation on what the parameters are (if any) and how to put the template in your page.


If a template with a lot of different optional parameters, like Template:Ambox, gets frequently used in one particular way, such as to mark stub articles, then we create a template which fills out a lot of the parameters for you, like Template:Stub. That way, instead of having to enter something like this on every stub page:

| name  = Stub
| type  = content
| image = [[File:Empire arms.png|40px]]
| text = ''This SeptemWiki article is a stub. Help us out by [{{fullurl:{{FULLPAGENAME}}|action=edit}} expanding it].
| category = Articles to be expanded

we can just use this:


This process can subdivide further, and further. The Stub template itself has several subtypes, which produce different looking stubs, with different icons and text.

Editing Templates

Not everyone with permission to edit an article has permission to edit templates, because you have the potential to break a lot of pages if you screw one up. If you need a template for something, either ask Shawn to do it or show him that you're really comfortable with the syntax.

All Template Pages