Template:Rarity: Difference between revisions
(add star mouseover caption) |
(add text string functionality) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{#switch: {{{1}}} | <includeonly>{{#if: {{{text|}}} | {{{1|}}}★ | {{#switch: {{{1}}} | ||
| 1 | | 1 | ||
| 2 | | 2 | ||
Line 18: | Line 18: | ||
| #default = {{{1|}}} | | #default = {{{1|}}} | ||
}} | }} | ||
}}</includeonly><noinclude> | |||
==Purpose== | |||
A template that resolves an integer into its respective star png or text string. Useful for infoboxes. | |||
==Parameter List== | |||
<pre> | |||
{{Rarity | |||
| <!-- Anonymous parameter. The desired value of the star png. --> | |||
|text = <!-- Whether a text string should be outputted instead of a star png. Treated as true if it's not blank. --> | |||
}} | |||
</pre> | |||
==Examples== | |||
===1★=== | |||
<pre>{{Rarity|1}}</pre> | |||
{{Rarity|1}} | |||
===12.5★=== | |||
<pre>{{Rarity|12.5}}</pre> | |||
{{Rarity|12.5}} | |||
===15★=== | |||
<pre>{{Rarity|15}}</pre> | |||
{{Rarity|15}} | |||
===15★, text only=== | |||
<pre>{{Rarity|15|text=1}}</pre> | |||
{{Rarity|15|text=1}} | |||
===30★=== | |||
<pre>{{Rarity|30}}</pre> | |||
{{Rarity|30}} | |||
</noinclude> |
Latest revision as of 13:38, 21 December 2023
Purpose
A template that resolves an integer into its respective star png or text string. Useful for infoboxes.
Parameter List
{{Rarity | <!-- Anonymous parameter. The desired value of the star png. --> |text = <!-- Whether a text string should be outputted instead of a star png. Treated as true if it's not blank. --> }}
Examples
1★
{{Rarity|1}}
12.5★
{{Rarity|12.5}}
12.5
15★
{{Rarity|15}}
15★, text only
{{Rarity|15|text=1}}
15★
30★
{{Rarity|30}}
30