Difference between revisions of "Help:Templates"

→‎Other Templates: added a description of source for quotes
(→‎Other Templates: added a description of source for quotes)
 
(11 intermediate revisions by 6 users not shown)
{{HelpToC}}
'''Templates''' make more complicated and repetitive editing tricks easier to do. This page will explain how to create and use them. For more details, see Wikipedia's Help page on [https://en.m.wikipedia.org/wiki/Help:Template Templates].
 
{{character
|image=Kelsier.jpg
|abilities=[[Allomancy|Mistborn]]
|image-artist=[[Kit Buss]]
|abilities=[[Mistborn]]
|spouse=[[Mare]]
|siblings=[[Marsh]]
|name=Kelsier
|image=Kelsier.jpg
|abilities=[[Allomancy|Mistborn]]
|image-artist=[[Kit Buss]]
|abilities=[[Mistborn]]
|spouse=[[Mare]]
|siblings=[[Marsh]]
 
=== Information Boxes ===
Called '''infoboxes''' for short, these templates create the tables at the upper right hand corner of articles. They display important facts and details which are common to articles of the same category. Infoboxes are ''placed at the start of the article''. There are infobox templates for all of the high level content categories, and a few others that are more specific. Common examples include {{t|book}}, {{t|character}}, {{t|magic system}}, and {{t|placelocation}}.
 
For more detailed help on infoboxes in general see [[:Help: Infoboxes]] and for a full list of infobox templates, see [[:Category: Infoboxes]].
 
=== Navigation Boxes ===
 
;{{t|move}}
: Requests that an administrator move the page (change the title). An unnamed parameter may be included to indicate which page it should be moved ''to''.
 
;Quality Tags
: Quality tags are simple templates that indicate the level of completion/quality of an article and categorize it accordingly. These are discussed in detail on the [[:Help:Categories#Quality_Tags|Help:Categories]] page and include {{t|stub}}, {{t|partial}}, and {{t|complete}}
 
=== Reference Templates ===
 
;{{t|quote}}
: Use {{t|quote}} to highlight some text as a quote. Use <code><nowiki>{{quote|TEXT|SOURCE}}</nowiki></code>, where <code>TEXT</code> is the quote itself and <code>SOURCE</code> is the source of the quote (typically the name of the speaker or a short description of the context, followed by a [[:Help:References|reference]]). <code><nowiki>{{quote|Do or do not. There is no try.|Yoda}}</nowiki></code> produces:
: {{quote|Do or do not. There is no try.|Yoda}}
 
;{{t|sidequote}}
: {{sidequote|Do or do not. There is no try.|Yoda|side=right|size=300px}} Use {{t|sidequote}} to place a quote on one side of the page, with text floating around it. Use <code><nowiki>{{sidequote|TEXT|SOURCE|POSITION|WIDTH}}</nowiki></code>, where <code>TEXT</code> is the quote itself, <code>SOURCE</code> is the source of the quote, <code>POSITION</code> is the alignment of the quote (<code>left</code> or <code>right</code>), and <code>WIDTH</code> is some number followed by "px", to specify the width of the quote in pixels. When placed at the top of this paragraph, <code><nowiki>{{sidequote|Do or do not. There is no try.|Yoda|side=right|size=300px}}</nowiki></code> produces the quote to the right.
 
;{{t|for}}
There are a number of functions that can be used to generate different results based on the input provided. For an extensive list, see [https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions MediaWiki's Parser Functions] page. Here are some of the basics:
 
;UpercasingUppercasing Text
: This function converts a string of text to all uppercase.
: ''Use:'' <code><nowiki>{{uc: TEXT}}</nowiki></code>, where <code>TEXT</code> is the text to be converted.
: This function performs a series of string compares until a "true" result is found.
: ''Use:'' <code><nowiki>{{#switch: X|A=Result1|B=Result2|C=Result3|etc.|Default}}</nowiki></code>, where <code>X</code> is compared to <code>A</code>, <code>B</code>, and so on. The first match provides the corresponding result. A final, default result may be provided in case no match is found.
: ''Example:'' <code><nowiki>{{#switch: cat|dog=bark|cat=meow|growl}}</nowiki></code> produces <code>meow</code> and <code><nowiki>{{#switch: bear|dog=bark|cat=meow|growl}}</nowiki></code> produces <code>growl</code>.
 
=== System Variables ===
Note: You might see a lot of these in existing templates, at the beginning and end of each line. White space can do strange things in templates, and so it is best to eliminate unnecessary white space by putting it inside of comments. One notable exception is inside tables, between the <code>|-</code> and the first cell <code>|</code>, which means the infobox {{t|row/kv}} (et al) can be nicely spaced without consequence.
 
 
[[Category: Help]]
{{help
|title=New Editor's Guide
|prev=[[Help:Categories|Categories]]
|this=Templates
|next=[[Help:What now?|What now?]]
}}
Editors, Keepers
2,004

edits