Template:WeaponCategory/doc: Difference between revisions

From Archaelund Wiki
(Created page with "== Description == This template contains the predefined weapon categories to be used within Template:Weapon and takes the corresponding tags ({{ListFormat|{{WeaponCategory|TagList}}|Bullets}}) as input. The output is the description to be displayed on the Wiki page. == Usage == <pre> {{WeaponCategory|<tag>}} </pre> For generating a semicolon-separated list of all available tags (intended for documentation purposes) use <pre> {{WeaponCategory|TagList}} </pre> == Tag...")
 
No edit summary
Line 24: Line 24:
<tr><td>Mace</td><td>{{WeaponCategory|Mace}}</td></tr>
<tr><td>Mace</td><td>{{WeaponCategory|Mace}}</td></tr>
<tr><td>Maul</td><td>{{WeaponCategory|Maul}}</td></tr>
<tr><td>Maul</td><td>{{WeaponCategory|Maul}}</td></tr>
<tr><td>Projectile</td><td>{{WeaponCategory|Projectile}}</td></tr>
<tr><td>Shortsword</td><td>{{WeaponCategory|Shortsword}}</td></tr>
<tr><td>Shortsword</td><td>{{WeaponCategory|Shortsword}}</td></tr>
<tr><td>Spear</td><td>{{WeaponCategory|Spear}}</td></tr>
<tr><td>Spear</td><td>{{WeaponCategory|Spear}}</td></tr>

Revision as of 11:47, 29 May 2025

Description

This template contains the predefined weapon categories to be used within Template:Weapon and takes the corresponding tags (Arrow • Axe • Bolt • Bow • Dagger • Greataxe • Greatsword • Hammer • Longbow • Longsword • Mace • Maul • Shortsword • Spear • Staff) as input. The output is the description to be displayed on the Wiki page.

Usage

{{WeaponCategory|<tag>}}

For generating a semicolon-separated list of all available tags (intended for documentation purposes) use

{{WeaponCategory|TagList}}

Tag options

TagOutput
AxeBattleaxe
BowBow
DaggerDagger
GreataxeGreataxe
GreatswordGreatsword
HammerHammer
LongbowLongbow
LongswordLongsword
MaceMace
MaulMaul
Projectile
ShortswordShortsword
SpearSpear
StaffStaff

How to add new weapon categories

In order to add a new category, you have to insert a new case in the template's #switch structure (only parts indicated by <...> may be edited):

|<NewTag> = <output text>

Also, add the new tag to the existing TagList case so it will appear in any documentation:

|TagList = ...; <NewTag>; ...