User blog:AegonLegends/The basics of Template creation

Preparation
The first step when it comes to the creation of something is to plan. Some things require little planning while some requires a huge plan, the more complex your template is, the more time you'll need to plan and train.

Make sure to stop to think before starting any template. There are some points:
 * Can you do it? This point may sound obvious but thinking if you can do something is very important, if you are doing it yourself.
 * Does the wiki need it? Another point that may sound obvious but is forgotten by many.
 * Can it be done using an existent template? If the answer to this is Yes, then think if which one would be more time consuming. If a Template is less time consuming, be sure that it needs to be reused, as there is no use for a Template that can be used only a few times.
 * How would it look and how would it work? This is the hardest one to some people, like me, as it's where the planning really begins. Have a mental, digital or physical image of how it would look like; try to think how it would work, put your logic to work and have a plan before the coding starts.

Appearance
This is the part where the design turns real. Take your image and make your template look like it. If you are getting used to how to edit wikicode you can start planning your templates using the Visual Editor and checking the Source Editor to learn the basics and, if you want, look at a CSS tutorial, as this is beyond the scope of this post.

A way to look at the appearance of your template is to use the "Preview" button when edit, however some things don't work there, as Switches or collapsible tables. Another good way is to have a "Sandbox". If you don't have one, you can click here and create it. It's a personal page so as long as it doesn't break the wiki's rules on profiles, you can add whatever you want there. Just edit, publish and move the next step, where the fun part begins.

Coding the template
When you write a template, you need to have a text or image that changes when the user uses it.

Here I'll show two of the most used commands on templates:

{| border="5" cellpadding="1" cellspacing="4" style="text-align: center; background-color:#151515; border:4px solid black; text-align: center;" ! scope="col"|Code ! scope="col"|How it works ! scope="col"|Example(Code) ! scope="col"|Example Result This is one of the simplest commands.

It gets a parameter and shows it.

Note:  The number means the number the "|" it responds to. means the first |, means the second | and so on. Template code: (Template:ExAmp):

On a page: This is the same command as before, just set up to display a something in case no input is given by the user.
 * The user inserted: Some random text WASD

It gets a parameter and shows it, it shows a pre-configured value in case no parameter is given. Template code: (Template:ExAmp):

On a page:

Almost the same command as before, but works different.
 * The user inserted: Another random typing KMFK
 *   or   
 *   or   

It gets a named parameter and shows it, it can show, if set up to, a pre-configured value in case no parameter is given. Template code: (Template:ExAmp):

On a page:
 * The user inserted: This ends it for now
 * }