3,796 bytes added
, 16:20, June 9, 2007
<div style="background-color:#dff; border:solid 1px blue; padding:5px; float:right; width:20em"><small>{{Newsline}}</small></div>
Using templates can be easy or hard, depending on the template. But normally they are easy.
== Basic instructions ==
A template is simply a page (usually a very brief one) that is inserted into another page.
For example, the three separate boxes on the [[Main Page]] ("Welcome to Conservapedia", "Breaking News", and "Today in History") are each actually separate pages that are "included" on the Main Page. In fact, they can be included on any page: The "Today in History" page has been included to the right just to demonstrate that point:
Templates are included on a page by typing the page name in double curly brackets. So to include ''this'' page on another page, you could type <small><tt><nowiki>{{help:Using templates}}</nowiki></tt></small>. If, however, the template is in "template" [[namespace]] (i.e. the page name starts with "template:"), then you don't need to include that bit. So to include the "Today in History" page, you would just type <tt><small><nowiki>{{Newsline}}</nowiki></small></tt>.
For simple templates, that's all there is to it.
== Parameters ==
However, many templates allow you to add to the information in the template, or to change it's appearance, by supplying ''parameters''.
For example, the ''Welcome'' template that someone might have put on your user talk page has two parameters. One is the name of user, and the other is the name of the person placing the welcome message. See the example below welcoming The Joker, placed by Batman:
{{welcome|Joker|sig=from Batman}}
(This was included on this page by typing <tt><small><nowiki>{{welcome|Joker|sig=from Batman}}</nowiki></small></tt>.)
"Pipe" characters (|) separate each parameter.
Parameters can be optional or required, and they can be named or not named. In the example above, the first parameter ("Joker") was not named, but the second ("from Batman") was named ''sig''. Two points need to be kept in mind with parameters:
* Named parameters can be supplied in any order.
* Un-named parameters must be supplied in the correct order.
Each template has (or will have) a list of parameters, looking something like this (this one is from the {{tl|welcome}} template):
{{Parms|
{{Parm|1|The user name|no (see note)|Defaults to the page name}}
{{Parm|sig|The signature of the editor posting the welcome ("<nowiki>~~~~</nowiki>" will do)|no}}
}}
This tells us the following:
* Neither parameter is required.
* The first parameter (shown as "1") is not named (hence the number, the order in which it must be supplied).
* The second parameter is named ("sig").
* If the first parameter is not supplied, then the page name is used instead.
You can assume that if no default is shown for a parameter that is not required, the result will be blank (i.e. in this case, the welcome message would not show who it was from).
You will notice that named parameters have the parameter name followed by an equals sign (=) followed by whatever you want that to be.
Parameters shown with numbers are the un-named parameters. You ''can'' treat them as named parameters, by typing 1=''your text'', but this is not necessary, except in the case that you want your text to include an equals sign (=).
You can set the parameter to be blank (although this should not normally be necessary) by typing nothing after the pipe character for an unnamed parameter, or nothing after the equals sign for a named parameter. For example, if you wanted the welcome template to not show "Joker" or "from Batman", you could type <tt><small><nowiki>{{welcome||sig=}}</nowiki></small></tt> (although, as mentioned, leaving the ''sig'' parameter out altogether has the same effect).
nsTeam2RO, nsTeam2RW, nsTeam2_talkRO, nsTeam2_talkRW