Help:Using templates
- July 26
- 1603 - James VI of Scotland was crowned King James I of England. He then 'authorised' an English translation of the Scriptures, first published in 1611 and known as the 'Authorised Version', or in America as the 'King James Version' of the Bible.
- 1775 - Benjamin Franklin becomes the 1st Postmaster General.
- 1788 - New York becomes 11th state to ratify the constitution.
- 1971 - Apollo 15 is launched to the Moon.
- July 25
- 1907 - Sir Robert Baden-Powell took some boys camping, in what was a precursor to the scouting movement.
- July 24
- 1725 - Birth of John Newton. Newton is remembered today as the author of several enduring hymns, including 'Amazing Grace' and 'Glorious Things of Thee Are Spoken.' Read about his amazing life here!
- 1758 - George Washington admitted to Virginia House of Burgess on this day.
- 1783 - Simon Bolivar the Liberator of Venezuela, Colombia, Ecuador, Panamá, Peru, Bolivia and champion of the union of American countries was born on this day.
- July 22
- 1822 - Gregor Mendel, a monk who became a pioneer in heredity studies, was born today.
- 1926 - Babe Ruth caught a baseball dropped from an airplane.
- 1933 - Wiley Post became the first man to fly solo around the world.
- 1934 - Notorious gangster John Dillinger was gunned down.
- 1975 - Congress restored the citizenship of Robert E. Lee.
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 {{help:Using templates}}. 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 {{Newsline}}.
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 the 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!
Hello, Joker, and welcome to Conservapedia!
We're glad you are here to edit. We ask that you read our Editor's Guide before you edit.
At the right are some useful links for you. You can include these links on your user page by putting "{{Useful links}}" on the page. Any questions--ask!
Thanks for reading, Joker!
- from Batman
(This was included on this page by typing {{welcome|Joker|sig=from Batman}}.)
"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 {{welcome}} template):
| Template Parameters (See using templates). | |||
|---|---|---|---|
| Name | Purpose | Required? | Comment |
| 1 | The user name | no (see note) | Defaults to the page name |
| sig | The signature of the editor posting the welcome ("~~~~" 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 (=).
What do you pass to parameters?
Obviously, you give a parameter the text that it expects, such as "from Batman" in the example above. But in most cases, you can give a parameter any text that you like. You could, for example, put "But break any laws and I'll bring the full weight of the law down on you, (signed) Batman"!
In some cases, however, specific text must be supplied. The {{Bible ref}} template, for example, expects a book of the Bible for the "book" parameter, and giving it something that is not a book of the Bible will break the link to BibleGateway that the template creates.
In many cases you can supply a blank value to the parameter. You can set a parameter to be blank 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 {{welcome||sig=}}
However, a well-written template will allow you to simply omit the parameter altogether, as the {{welcome}} template does with the sig parameter.