Template:BadgeBox/doc: Difference between revisions

From Unofficial Homecoming Wiki
Jump to navigation Jump to search
(updated "left" parameter example, different sized icons)
(match SMW Page datatype format)
Line 7: Line 7:
The first way is to specify the graphic, the badge name, and the badge description as thus:
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>
<nowiki>{{BadgeBox|File: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.)
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>
<nowiki>{{BadgeBox|File:Image.png|Badge Name}}</nowiki>


The third way is to omit the graphic and the description. If omitted, they will both be automatically filled in from the badge's article using the section titled "Description" and the image displayed through the {{tl|Image}} template. (If either do not exist, an error occurs.)
The third way is to omit the graphic and the description. If omitted, they will both be automatically filled in from the badge's article using the section titled "Description" and the image displayed through the {{tl|Image}} template. (If either do not exist, an error occurs.)
Line 36: Line 36:
==Examples==
==Examples==
Here is an example template call for a badge, providing a custom description:
Here is an example template call for a badge, providing a custom description:
:<nowiki>{{BadgeBox|badge_stature_03.png|Plague Stopper|Custom description.}}</nowiki>
:<nowiki>{{BadgeBox|File:badge_stature_03.png|Plague Stopper|Custom description.}}</nowiki>


This will output:
This will output:
{{BadgeBox|badge_stature_03.png|Plague Stopper|Custom description.}}
{{BadgeBox|File:badge_stature_03.png|Plague Stopper|Custom description.}}




Here is an example template call for a badge, using the automatic description:
Here is an example template call for a badge, using the automatic description:
: <nowiki>{{BadgeBox|badge_stature_03.png|Plague Stopper}}</nowiki>
: <nowiki>{{BadgeBox|File:badge_stature_03.png|Plague Stopper}}</nowiki>


This will output:
This will output:
{{BadgeBox|badge_stature_03.png|Plague Stopper}}
{{BadgeBox|File:badge_stature_03.png|Plague Stopper}}




Line 57: Line 57:


Here is an example template call showing how to suppress the description completely:
Here is an example template call showing how to suppress the description completely:
: <nowiki>{{BadgeBox|Badge tourist 01.png|Apex|3=&amp;nbsp;}}</nowiki>
: <nowiki>{{BadgeBox|File:Badge tourist 01.png|Apex|3=&amp;nbsp;}}</nowiki>


This will output:
This will output:
{{BadgeBox|Badge tourist 01.png|Apex|3=&nbsp;}}
{{BadgeBox|File:Badge tourist 01.png|Apex|3=&nbsp;}}




Here are some examples with the which= option:
Here are some examples with the which= option:
: <nowiki>{{BadgeBox|Resolute|which=Vet}}</nowiki>
: <nowiki>{{BadgeBox|Resolute|which=Vet}}</nowiki>
: <nowiki>{{BadgeBox|Badge vr months generic.png|Resolute|which=Veteran}}</nowiki>
: <nowiki>{{BadgeBox|File:Badge vr months generic.png|Resolute|which=Veteran}}</nowiki>
: <nowiki>{{BadgeBox|Badge vr months generic.png|Resolute|Custom description.|which=Veteran}}</nowiki>
: <nowiki>{{BadgeBox|File:Badge vr months generic.png|Resolute|Custom description.|which=Veteran}}</nowiki>


This will output:
This will output:
{{BadgeBox|Resolute|which=Vet}}
{{BadgeBox|Resolute|which=Vet}}
{{BadgeBox|Badge vr months generic.png|Resolute|which=Veteran}}
{{BadgeBox|File:Badge vr months generic.png|Resolute|which=Veteran}}
{{BadgeBox|Badge vr months generic.png|Resolute|Custom description.|which=Veteran}}
{{BadgeBox|File:Badge vr months generic.png|Resolute|Custom description.|which=Veteran}}





Revision as of 09:38, 14 May 2022

This is a documentation subpage for Template:BadgeBox (see that page for the template itself).
It contains usage information, categories and other content that is not part of the original template page.

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 three ways to use this template.

The first way is to specify the graphic, the badge name, and the badge description as thus:

{{BadgeBox|File: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|File:Image.png|Badge Name}}

The third way is to omit the graphic and the description. If omitted, they will both be automatically filled in from the badge's article using the section titled "Description" and the image displayed through the {{Image}} template. (If either do not exist, an error occurs.)

{{BadgeBox|Badge Name}}

Note that some badges have a different graphic and/or a different description for heroes and villains. Most badges will work fine automatically (once set up), but some may require additional parameters to get the exact effect you want.

Additionally, you can supply the which= option to specify which of a set of disambig pages to refer to; the which= should refer to the parenthetical after the badge name.

{{BadgeBox|Badge Name|which=Type}}

Additionally, you can specify a width for the left using left=. You should provide a number, which will be treated as a width in pixels. This allows a series of badge boxes to line up well.

{{BadgeBox|Badge Name|left=number}}

Additionally, you can supply the monument= option to add additional information after the description, for instance the monument coordinates.

{{BadgeBox|Badge Name|monument=text}}

Limitation

BadgeBox may only be used once per badge if you're going to let it auto-detect the description. If you call the same badge twice on one page, the second one will get a page link instead of the description. (However, we shouldn't have multiple BadgeBoxes for a single badge on a page anyway.)

Examples

Here is an example template call for a badge, providing a custom description:

{{BadgeBox|File:badge_stature_03.png|Plague Stopper|Custom description.}}

This will output:

[[|link=|alt=Badge]]


Here is an example template call for a badge, using the automatic description:

{{BadgeBox|File:badge_stature_03.png|Plague Stopper}}

This will output:

[[|link=|alt=Badge]]


Here is an example template call for a badge, using the automatic description and image:

{{BadgeBox|Apex}}

This will output:

Badge
Apex (278.0, 56.8, -2257.0)[Copy]

Apex tracked Dr. Vahzilok down to this location, but interference from the Circle of Thorns prevented him from capturing the mad scientist.


Here is an example template call showing how to suppress the description completely:

{{BadgeBox|File:Badge tourist 01.png|Apex|3=&nbsp;}}

This will output:

[[|link=|alt=Badge]]


Here are some examples with the which= option:

{{BadgeBox|Resolute|which=Vet}}
{{BadgeBox|File:Badge vr months generic.png|Resolute|which=Veteran}}
{{BadgeBox|File:Badge vr months generic.png|Resolute|Custom description.|which=Veteran}}

This will output:

Badge
Hero
For 75 months in City of Heroes you will earn an additional 10% Prestige from defeating enemies.
Villain
For 75 months in City of Heroes you will earn an additional 10% Prestige from defeating enemies.
[[|link=|alt=Badge]]
[[|link=|alt=Badge]]


Here is an example using the left= option:

{{BadgeBox|left=78|Top Dog}}
{{BadgeBox|Atlas Tour Guide}}

This will output:

Badge
Top Dog (131.0, 319.7, -319.5)[Copy]

The top of Atlas' statue is the first place many flying heroes will go.

Badge

You've obtained this Accolade by earning every Exploration badge within Atlas Park.

Here is an example using the monument= option:

{{BadgeBox|Intellectual|monument=* [[Intellectual Badge#Monument 1|Monument 1]] {{coords|2381|0|-1251}}}}

This will output:

Badge

You have learned the history of the Lost's attempt to control the minds of Paragon City's people.