Template:BadgeBox: Difference between revisions

From Homecoming Wiki
Jump to navigation Jump to search
(both /fixed and /auto are identical (with different outputs), combined as /core)
(pass image parameter as file name instead of full link, flexibility for link, alt etc)
Line 1: Line 1:
<includeonly>{{#if: {{{2|}}}
<includeonly>{{#if: {{{2|}}}
| {{BadgeBox/core
| {{BadgeBox/core
   |image=[[Image:{{{1}}}]]
   |image={{{1}}}
   |badge={{{2}}}
   |badge={{{2}}}
   |which={{{which|}}}
   |which={{{which|}}}
Line 8: Line 8:
   }}
   }}
| {{BadgeBox/core
| {{BadgeBox/core
   |image={{#ask:[[{{{1}}} Badge {{#if:{{{which|}}}|({{{which}}})|}}]]|?Image|limit=1|default=|format=list|link=none|template=Template:BadgeBox/icons}}
   |image={{#explode:{{#ask:[[{{{1}}} Badge {{#if:{{{which|}}}|({{{which}}})|}}]]|?Image|limit=1|default=|format=list|link=none|template=Template:BadgeBox/icons}}|,|0}}
  |image 2={{#explode:{{#ask:[[{{{1}}} Badge {{#if:{{{which|}}}|({{{which}}})|}}]]|?Image|limit=1|default=|format=list|link=none|template=Template:BadgeBox/icons}}|,|1}}
   |badge={{{1}}}
   |badge={{{1}}}
   |which={{{which|}}}
   |which={{{which|}}}

Revision as of 09:22, 12 May 2022

[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

Badge data is automatically filled in from the badge article. {{Badge display}} on the badge page provides the data. A combination of {{Image}} and a section with heading "Description" also works, but is deprecated.

{{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. Or, you can supply the link= option to specify the exact page title.

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

If the data comes from a section with heading "Description", BadgeBox will work only once per badge per page. If you call BadgeBox for the same badge twice on one page, the second BadgeBox will have a page link instead of the description.

If the data comes from {{Badge display}}, this limitation doesn't apply.

Examples

Basic use

{{BadgeBox|Law Enforcer}}
"[[SMW" contains a listed "[" character as part of the property label and has therefore been classified as invalid.
[[{{{link}}}|File:Badge DayJob LawEnforcement.png]]

File:Badge DayJob LawEnforcement.png Badge

|link=|alt=Badge]]
[[{{{link}}}|Law Enforcer]]

Which parameter

Pulls data from a badge article with a parenthetical disambiguation after the title, e.g., the historical Terminator Badge (AE) vs the current Terminator Badge.

{{BadgeBox|Terminator|which=AE}}
{{BadgeBox|Terminator}}
"[[SMW" contains a listed "[" character as part of the property label and has therefore been classified as invalid.
[[{{{link}}}|File:Badge ArchitectDefeatedPlayers500.png]]

File:Badge ArchitectDefeatedPlayers500.png Badge

|link=|alt=Badge]]
[[{{{link}}}|Terminator]]

You've defeated 5000 custom enemies during published Architect missions earning yourself the Terminator badge.

"[[SMW" contains a listed "[" character as part of the property label and has therefore been classified as invalid.
[[{{{link}}}|File:Badge Terminator.png]]

File:Badge Terminator.png Badge

|link=|alt=Badge]]
[[{{{link}}}|Terminator]]

Link parameter

Pulls data from a badge article with the exact page name specified.

{{BadgeBox|Silent Sentinel}}
{{BadgeBox|link=Silent Sentinel Badge}}
"[[SMW" contains a listed "[" character as part of the property label and has therefore been classified as invalid.
[[{{{link}}}|File:Badge tourist 01.png]]

File:Badge tourist 01.png Badge

|link=|alt=Badge]]
[[{{{link}}}|Silent Sentinel]]
[[|link=|alt=Badge]]
[[{{{link}}}|{{{1}}}]]

Left parameter

Gives a smaller badge more space, to align with a large badge.

{{BadgeBox|left=78|Top Dog}}
{{BadgeBox|Atlas Tour Guide}}
"[[SMW" contains a listed "[" character as part of the property label and has therefore been classified as invalid.
[[{{{link}}}|File:Badge tourist 01.png]]

File:Badge tourist 01.png Badge

|link=|alt=Badge]]
[[{{{link}}}|Top Dog]]
"[[SMW" contains a listed "[" character as part of the property label and has therefore been classified as invalid.
[[{{{link}}}|File:Badge HeroExploreAccolade.png]]

File:Badge HeroExploreAccolade.png Badge

|link=|alt=Badge]]
[[{{{link}}}|Atlas Tour Guide]]

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

Monument parameter

{{BadgeBox|Intellectual|monument=* [[Intellectual Badge#Monument 1|Monument 1]] {{coords|2381|0|-1251}}}}
"[[SMW" contains a listed "[" character as part of the property label and has therefore been classified as invalid.
[[{{{link}}}|File:Badge history 01.png]]

File:Badge history 01.png Badge

|link=|alt=Badge]]
[[{{{link}}}|Intellectual]]

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