Template:BadgeBox: Difference between revisions
imported>Sekoia (historical) (adding DPL code to automatically grab the badge's description if the third parameter is omitted) |
imported>Sekoia (historical) (adding documentation) |
||
Line 1: | Line 1: | ||
<div style="margin: 0.5em;"> | <includeonly><div style="margin: 0.5em;"> | ||
{| style="background-color: #F4F4FF; border: 1px solid #AAAAFF;" | {| style="background-color: #F4F4FF; border: 1px solid #AAAAFF;" | ||
| style="vertical-align: top; padding: 0.25em;" | [[Image:{{{1}}}]] | | style="vertical-align: top; padding: 0.25em;" | [[Image:{{{1}}}]] | ||
| style="width:100%; padding: 0.25em;" | '''[[{{{2}}} Badge|{{{2}}}]]'''<br> | | style="width:100%; padding: 0.25em;" | '''[[{{{2}}} Badge|{{{2}}}]]'''<br> | ||
{{if|test={{{3|}}}|then={{{3}}}|else={{#dpl: title={{{2}}} Badge | includepage=#Description}}}} | {{if|test={{{3|}}}|then={{{3}}}|else={{#dpl: title={{{2}}} Badge | includepage=#Description}}}} | ||
|}</div><noinclude>[[Category:Templates]]</noinclude> | |}</div></includeonly><noinclude>__NOTOC__ | ||
==Overview== | |||
This template is used to generate a badge box for displaying the badge graphic, badge name, and badge description for a badge. | |||
==Usage== | |||
There are two ways to use this template. | |||
The first way is to specify the graphic, the badge name, and the badge description as thus: | |||
<nowiki>{{BadgeBox|Image.png|Badge Name|Description}}</nowiki> | |||
The second way is to omit the description. If the description is omitted, the description will automatically be filled in from the badge's article using the section titled "Description". (If there is no such section, an error occurs.) | |||
<nowiki>{{BadgeBox|Image.png|Badge Name}}</nowiki> | |||
==Examples== | |||
Here is an example template call for a badge, providing a custom description: | |||
:<nowiki>{{BadgeBox|badge_stature_03.png|Plague Stopper|Custom description.}}</nowiki> | |||
This will output: | |||
{{BadgeBox|badge_stature_03.png|Plague Stopper|Custom description.}} | |||
Here is an example template call for a badge, using the automatic description: | |||
: <nowiki>{{BadgeBox|badge_stature_03.png|Plague Stopper}}</nowiki> | |||
This will output: | |||
{{BadgeBox|badge_stature_03.png|Plague Stopper}} | |||
Here is an example template call showing how to suppress the description completely: | |||
: <nowiki>{{BadgeBox|badge_stature_03.png|Plague Stopper|3=&nbsp;}}</nowiki> | |||
This will output: | |||
{{BadgeBox|badge_stature_03.png|Plague Stopper|3= }} | |||
[[Category:Templates]]</noinclude> |
Revision as of 09:13, 10 May 2007
Overview
This template is used to generate a badge box for displaying the badge graphic, badge name, and badge description for a badge.
Usage
There are two ways to use this template.
The first way is to specify the graphic, the badge name, and the badge description as thus:
{{BadgeBox|Image.png|Badge Name|Description}}
The second way is to omit the description. If the description is omitted, the description will automatically be filled in from the badge's article using the section titled "Description". (If there is no such section, an error occurs.)
{{BadgeBox|Image.png|Badge Name}}
Examples
Here is an example template call for a badge, providing a custom description:
- {{BadgeBox|badge_stature_03.png|Plague Stopper|Custom description.}}
This will output:
Plague Stopper Template:If: "#if{{{1}}}:{{{2}}}" should give {{#if{{{1}}}:{{{2}}}|true|false}} but may not be evaluated due to the expansion depth limit. |
Here is an example template call for a badge, using the automatic description:
- {{BadgeBox|badge_stature_03.png|Plague Stopper}}
This will output:
Plague Stopper Template:If: "#if{{{1}}}:{{{2}}}" should give {{#if{{{1}}}:{{{2}}}|true|false}} but may not be evaluated due to the expansion depth limit. |
Here is an example template call showing how to suppress the description completely:
- {{BadgeBox|badge_stature_03.png|Plague Stopper|3= }}
This will output:
Plague Stopper Template:If: "#if{{{1}}}:{{{2}}}" should give {{#if{{{1}}}:{{{2}}}|true|false}} but may not be evaluated due to the expansion depth limit. |