Template:RarityWithArticle: Difference between revisions
Jump to navigation
Jump to search
m update to also support when a value of "common" is explicitly provided |
HiddenDragon (talk | contribs) mNo edit summary |
||
Line 9: | Line 9: | ||
| an (unknown rarity) | | an (unknown rarity) | ||
}} | }} | ||
|a common}}</includeonly><noinclude> | |a common}}</includeonly><noinclude>{{Documentation|content= | ||
This is useful for auto-generating text with a template, in which you'd like to refer to an item's rarity in the flow of a sentence, like so: | This is useful for auto-generating text with a template, in which you'd like to refer to an item's rarity in the flow of a sentence, like so: | ||
Line 25: | Line 25: | ||
The Weird Sword is {{RarityWithArticle|what's this}} item. | The Weird Sword is {{RarityWithArticle|what's this}} item. | ||
}} | |||
[[Category:Templates]] | |||
</noinclude> | </noinclude> |
Latest revision as of 21:29, 19 January 2025
Template documentation
This is useful for auto-generating text with a template, in which you'd like to refer to an item's rarity in the flow of a sentence, like so:
The {{{name}}} is {{RarityWithArticle|{{{rarity}}}}} item.
Suppose the 'name' is "Worgfang" and the 'rarity' is "uncommon". Then the result would be:
The Worgfang is an uncommon item.
For an empty rarity value, it will say "a common":
The Dagger is a common item.
For an invalid / unrecognized rarity value, it will say "an (unknown rarity)":
The Weird Sword is an (unknown rarity) item.