Badge time.png   The Paragon Wiki Archive documents the state of City of Heroes/Villains as it existed on December 1, 2012.

Difference between revisions of "Template:BadgeBox"

From Paragon Wiki Archive
Jump to: navigation, search
(added imgwidth parameter)
(attempting to fix)
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><div style="margin: 0.5em;">
+
<includeonly>{{#if: {{{2|}}}
{|  style="background-color: #F4F4FF; border: 1px solid #AAAAFF;"
+
| {{BadgeBox/{{#if:{{{left|}}}|fixed|auto}}
{{#if: {{{2|}}}|{{!}} style="vertical-align: top; padding: 0.25em; {{#if:{{{imgwidth|}}}|width: {{{imgwidth}}}}}" {{!}} [[Image:{{{1}}}]]
+
  |image=[[Image:{{{1}}}]]
{{!}} style="width:100%; padding: 0.25em;" {{!}} '''[[{{{2}}} Badge {{#if:{{{which|}}}|({{{which}}})|}}|{{{2}}}]]'''<br />
+
  |badge={{{2}}}
{{#if:{{{3|}}}|{{{3}}}|{{#dpl: title={{{2}}} Badge | allowcachedresults=true | includepage=#Description}}}}
+
  |which={{{which|}}}
|
+
  |desc={{#if:{{{3|}}}|{{{3}}}|{{#lsth:{{{2}}} Badge {{#if:{{{which|}}}|({{{which}}})|}}|Description}}}}
{{!}} style="vertical-align: top; padding: 0.25em; {{#if:{{{imgwidth|}}}|width: {{{imgwidth}}}}}" {{!}} {{#dpl: title={{{1}}} Badge {{#if:{{{which|}}}|({{{which}}})|}} | allowcachedresults=true | includepage={Image} }}
+
  |left={{{left|}}}
{{!}} style="width:100%; padding: 0.25em;" {{!}} '''[[{{{1}}} Badge {{#if:{{{which|}}}|({{{which}}})|}}|{{{1}}}]]'''<br />
+
  }}
{{#dpl: title={{{1}}} Badge {{#if:{{{which|}}}|({{{which}}})|}} | allowcachedresults=true | includepage=#Description}}}}
+
| {{BadgeBox/{{#if:{{{left|}}}|fixed|auto}}
|}</div></includeonly><noinclude>{{Documentation}}</noinclude>
+
  |image={{#ask:[[{{{1}}} Badge {{#if:{{{which|}}}|({{{which}}})|}}]]|?Image|limit=1|default=|format=list|link=none|template=Template:BadgeBox/icons}}
 +
  |badge={{{1}}}
 +
  |which={{{which|}}}
 +
  |desc={{#lsth:{{{1}}} Badge {{#if:{{{which|}}}|({{{which}}})|}}|Description}}
 +
  |left={{{left|}}}
 +
  }}
 +
}}</includeonly><noinclude>{{Documentation}}</noinclude>

Latest revision as of 21:23, 12 January 2015

[edit] [purge] Documentation

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|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}}

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.

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|badge_stature_03.png|Plague Stopper|Custom description.}}

This will output:

Badge stature 03.png Plague Stopper

Custom description.


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

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

This will output:

Badge stature 03.png Plague Stopper

You were key in stopping a plague from overtaking Paragon City.


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

{{BadgeBox|Apex}}

This will output:

File:Badge tourist 01.png Apex

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|Badge tourist 01.png|Apex|3=&nbsp;}}

This will output:

Badge tourist 01.png Apex

 


Here are some examples with the which= option:

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

This will output:

File:Badge vr months 075.png Resolute
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.
Badge vr months generic.png Resolute
Hero
Against all odds you've withstood the challenges that have been thrown your way and came out on top. This badge has been granted to you for earning twenty six Reward Tokens.
Villain
Against all odds you've withstood the challenges that have been thrown your way and came out on top. This badge has been granted to you for earning twenty six Reward Tokens.
Badge vr months generic.png Resolute

Custom description.


Here is an example using the left= option:

{{BadgeBox|left=130|Enhancer}}
{{BadgeBox|left=130|Vendor}}

This will output:

File:Badge auction seller hero.pngFile:Badge auction seller villain.png Enhancer

You've sold 50 Enhancements on the Auction House.

File:Badge auction seller 01.png Vendor

You've sold 10 items on the Auction House.