Difference between revisions of "Help:Templates"

m
→‎Example: Update example infobox
m (Fix Mistborn disambig link and sidequote parameters)
m (→‎Example: Update example infobox)
 
(3 intermediate revisions by 3 users not shown)
{{character
|image=Kelsier.jpg
|abilities=[[Allomancy|Mistborn]]
|spouse=[[Mare]]
|siblings=[[Marsh]]
|titles=Survivor
|born=c. 984 FE
|abilities=[[Allomancy|Mistborn]]
|world=Scadrial
|titles=Survivor
|ethnicity=Skaa
|residence=Luthadel
|ethnicity=Skaa
|books=[[Mistborn (series)]]
|world=Scadrial
|universe=[[Cosmere]]
|introduced=[[Mistborn: The Final Empire]]
}}
</pre>
|
{{example|name=Kelsier
|name=Kelsier
|image=Kelsier.jpg
|abilities=[[Allomancy|Mistborn]]
|spouse=[[Mare]]
|siblings=[[Marsh]]
|titles=Survivor
|born=c. 984 FE
|abilities=[[Allomancy|Mistborn]]
|world-raw=Scadrial
|titles=Survivor
|ethnicity-raw=Skaa
|residence=Luthadel
|ethnicity-raw=Skaa
|books=[[Mistborn (series)]]
|world-raw=Scadrial
|universe=[[Cosmere]]
|introduced=[[Mistborn: The Final Empire]]
}}
|}
 
;{{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}}
 
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 ===