Difference between revisions of "Help:Using templates"
(→Basic instructions: Long-overdue update, and formatting) |
(Update) |
||
| Line 1: | Line 1: | ||
| − | <div style="background-color:#dff; border:solid 1px blue; padding:5px; float:right; width:20em"><small>{{ | + | <div style="background-color:#dff; border:solid 1px blue; padding:5px; float:right; width:20em"><small>{{mainpageleft}}</small></div> |
Using templates can be easy or hard, depending on the template. But normally they are easy. | Using templates can be easy or hard, depending on the template. But normally they are easy. | ||
| + | |||
== '''Before you can attach your own template to any CP page, you will need to submit it for approval at [[Template Submission]].''' == | == '''Before you can attach your own template to any CP page, you will need to submit it for approval at [[Template Submission]].''' == | ||
Revision as of 10:48, February 24, 2008
Conservapedia: Over 1 BILLION page views! Free courses.
Popular articles at Conservapedia
Conservapedia seeks new content writers
Please become a new content writer at Conservapedia HERE.
And join the Conservapedia Study Bible project.
Famous quotes
- "Feminism is doomed to failure because it is based on an attempt to repeal and restructure human nature."- Phyllis Schlafly
- “There are no ordinary people. You have never talked to a mere mortal. Nations, cultures, arts, civilizations - these are mortal, and their life is to ours as the life of a gnat. But it is immortals whom we joke with, work with, marry, snub and exploit - immortal horrors or everlasting splendors." - C.S. Lewis, Christian apologist and ex-atheist
- "Worldwide, the march of religion can probably only be reversed by a renewed, self-aware secularism. Today, it appears exhausted and lacking in confidence... Secularism's greatest triumphs owe less to science than to popular social movements like nationalism, socialism and 1960s anarchist-liberalism. Ironically, secularism's demographic deficit means that it will probably only succeed in the twenty-first century if it can create a secular form of 'religious' enthusiasm." - Eric Kaufmann
Atheism vs. Christianity article resources
- Atheism
- Atheism articles
- Rebuttals to atheist arguments
- Atheism vs. Christianity
- Evidence for Christianity
- Atheism vs. Christianity debates
- Christianity statistics
- Atheism statistics
- Resources for leaving atheism and becoming a Christian
- Christianity and its margin of victory over atheism
Quick links
- Conservapedia:Copyright - AI reuse friendly
- The Conservapedia Commandments
- Conservapedia:About
- Conservapedia:Quick reference
- Guidelines
- Manual of Style
- Conservapedia:Contact Us
- Conservapedia:Community Portal
- How to put links and footnotes into your articles
- How to create and maintain high-quality articles
- Conservapedia essays
- Conservapedia debates
- Articles mentioning Conservapedia.
- Videos on Conservapedia.
- Please read how Conservapedia differs from Wikipedia at: How Conservapedia Differs from Wikipedia
- A list of frequently asked questions.
- Conservapedia terms
- Image upload requests
- Page move requests
- A good explanation as to what constitutes copyrighted images.
- See here for administrator intervention.
- All the material on this site is subject to this disclaimer, and by using this site you agree to its terms.
- For any claims of copyright infringement by this site, see DMCA Agent.
Contact us
Recommended websites
Using templates can be easy or hard, depending on the template. But normally they are easy.
Before you can attach your own template to any CP page, you will need to submit it for approval at Template Submission.
Basic instructions
A template is simply a page (usually a very brief one) that is inserted into another page.
For example, the two separate boxes on the Main Page ("Mainpageleft" and "Mainpageright") are each actually separate pages that are "included" on the Main Page. In fact, they can be included on any page: The "Mainpageleft" 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 "Mainpageleft" page, you would just type {{Mainpageleft}}.
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.