Format Rules/Templates

From All The Fallen Stories
Jump to navigation Jump to search

Using templates can make things a whole lot easier if you have a lot of repetition in your story. Basically, a template is a page that can be inserted into any other page. This is especially handy for Game-type stories.


To make a template, all one has to do is name the template, and surround it with double curly braces {{Template:My Template}}. Then, you click on the red link that it generates, and make your template page the way that you make a normal page. Templates should always be added to the story category as well as the template category, and categories should be surrounded by the <noinclude> tag so that the template doesn't pass on it's categories to the pages that it is placed on:

<noinclude>[[Category:My Story]] [[Category:Template]]</noinclude>

.

So that is handy in and of itself, but what really makes Templates truly useful is that they can accept Parameters. You can think of Parameters as bits of information that might change from one use of a template to the next. You can define a Parameter by placing the parameter name in triple curly braces where you want the information to show up on your Template page: {{{My Parameter}}}.


Let's make a basic status bar for a Game-type story as an example. In this example I will also be using some table markup and XHTML attributes, but that is not necessary for a template. They follow the same rules as a normal page.

Status Equipment:
Health {{{Health}}} {{{Equipment}}}
MP {{{MP}}}
Level {{{Level}}}


Now, you may have noticed that the parameters are all empty. Well this will not do. Lets fill them. You fill a parameter by adding a vertical bar and the ParameterName=Value. Do this for each parameter thus: {{Sample Template|Health=100|MP=50|Level=1|Equipment=Wooden Sword, Peasant Clothes}}. Notice that it is a bit cumbersome and difficult to read; and that's with just four parameters. Well, you can break it up into multiple lines, thus:

{{Sample Template
|Health=100
|MP=50
|Level=1
|Equipment=Wooden Sword, Peasant Clothes
}}

Isn't that easier to read? Now lets see what it looks like:

Status Equipment:
Health 100 Wooden Sword, Peasant Clothes
MP 50
Level 1


If you want to get into Templates more in depth, you can read more at https://meta.wikimedia.org/wiki/Help:Template.