From Brotato Wiki

(add option to show DLC badge)
(Update template data to include "dlcbadge" (and "nolink", as that needed doing too))
 
(One intermediate revision by the same user not shown)
Line 47: Line 47:
     SHOW DLC BADGE? (only show if this has isdlc=1 in its template data)
     SHOW DLC BADGE? (only show if this has isdlc=1 in its template data)
-->{{#ifeq:{{{dlcbadge}}}|1|<!--
-->{{#ifeq:{{{dlcbadge}}}|1|<!--
         -->{{#ifeq:{{GetDLCStatus|{{{name|{{{1|}}}}}}|isdlc}}|1|{{DLC_Badge}}|}}<!--
         -->{{#ifeq:{{GetDLCStatus|{{{name|{{{1|}}}}}}|isdlc}}|1|{{DLCBadge}}|}}<!--
     -->|}}<!--
     -->|}}<!--
--></div><!--
--></div><!--
Line 177: Line 177:
"description": "If not set, uses the specified name. Always links to the name. Use \"no\" to hide the caption",
"description": "If not set, uses the specified name. Always links to the name. Use \"no\" to hide the caption",
"type": "string",
"type": "string",
"suggested": true
},
"nolink": {
"label": "Disabling link the Text?",
"type": "boolean",
"suggested": true
},
"dlcbadge": {
"label": "Show DLC Badge?",
"description": "Use 1 to enable showing the badge. Or - if not.",
"type": "boolean",
"suggested": true
"suggested": true
}
}
Line 189: Line 200:
"top",
"top",
"nobr",
"nobr",
"maxwidth"
"maxwidth",
]
"dlcbadge",
"nolink"
],
"format": "inline"
}
}
</templatedata></noinclude>
</templatedata></noinclude>

Latest revision as of 22:59, 10 November 2024


Usage

This template can be used by entering the following onto a relevant page. Do not use this on your user page. It is reserved for content pages.

{{Iconbox|Acid|size=30px|caption=caption|amount=1|rarity=1}}

Examples

Code Preview
{{Iconbox|Acid}}
{{Iconbox|Acid|amount=1}}
{{Iconbox|Acid|caption=Foobar}}
{{Iconbox|Acid|caption=no}}
Acid
{{Iconbox|Acid|top=Foobar}}
Acid

Foobar
Acid
{{Iconbox|Acid|rarity=-1}}


{{Iconbox|Acid|rarity=1}}
{{Iconbox|Acid|rarity=2}}
{{Iconbox|Acid|rarity=3}}
{{Iconbox|Acid|rarity=4}}
{{Iconbox|Acid|rarity=5}}

{{Iconbox|Acid|rarity=auto}}
{{Iconbox|Acid|nolink=1}}
Acid.png

Acid
{{Iconbox|Acid|image=Tree}}
{{Iconbox|Acid|size=30px}}
{{Iconbox|Acid|size=30px|nobr=1}}
Acid
  Acid
{{Iconbox|Acid|size=30px|nobr=1|top=Foobar}}
Acid
  Foobar  Acid
{{Iconbox|Acid|dlcbadge=1}}
{{Iconbox|Anchor|dlcbadge=1}}
Anchor

Anchor(DLC)

Other Options

The maxwidth option lets you restrain text that would otherwise be very long:

{{Iconbox|Acid|size=60px|top=This text is quite long but maxwidth restrains it|maxwidth=120px}}

Acid

This text is quite long but maxwidth restrains it
Acid


No description.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Namename 1

Name of the character/item/weapon

Stringrequired
Rarityrarity

Options: -1, 1, 2, 3, 4, auto

Numbersuggested
Sizesize

Size with px, eg. "30px"

Stringsuggested
Amountamount

Shows a number on the bottom right corner

Numbersuggested
Image Overrideimage

If not set, uses the image that matches the name

Stringsuggested
Caption Overridecaption

If not set, uses the specified name. Always links to the name. Use "no" to hide the caption

Stringsuggested
Top Texttop

Shown above the caption

Unknownsuggested
Prevent Line Breaks?nobr

If enabled, removes the line break, putting the icon and text on a single line. Use 1 to enable

Booleansuggested
Max Widthmaxwidth

If set, constrains the box to the specified width. Accepts any valid CSS width (60px, 60%). If not set, uses max-width:initial.

Example
60px
Stringsuggested
Show DLC Badge?dlcbadge

Use 1 to enable showing the badge. Or - if not.

Booleansuggested
Disabling link the Text?nolink

no description

Booleansuggested