Difference between revisions of "Help:Templates"

→‎Other Templates: added a description of source for quotes
m
(→‎Other Templates: added a description of source for quotes)
 
(3 intermediate revisions by 2 users not shown)
{{character
|image=Kelsier.jpg
|abilities=[[Allomancy|Mistborn]]
|spouse=[[Mare]]
|siblings=[[Marsh]]
|name=Kelsier
|image=Kelsier.jpg
|abilities=[[Allomancy|Mistborn]]
|spouse=[[Mare]]
|siblings=[[Marsh]]
 
;{{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 ===
Editors, Keepers
2,004

edits