Template:Category handler/doc

Adds every category listed in the unnamed parameters to the page it is used on. This handler also includes built in sorting mechanics:


 * Pages that match the category name exactly will be sorted as, placing them at the front of the category.
 * This rule also applies to titles that are simple plurals of each other; e.g. Rune and Runes
 * Pages that begin with the category will be sorted with the beginning removed.
 * e.g. Ruby amulet will be sorted into Category:Ruby as
 * Subpages are handled similarly; e.g. Dungeoneering/Abbreviations will be sorted as

This template is not a tool that should be used directly on pages, as it is more efficient for the page itself to use standard categorisation. The main purpose of this tool is to provide categorisation rules for navboxes to mass categorise and sort pages.


 * Usage


 * Example:

Placed on most pages, this would produce

On the page Mining, however, it would produce

On Rune battleaxe, it would produce

Modifiers
These are modifiers that can be used (in any order and amount) by appending them after the category name.


 * Important notes for all modifiers
 * Several characters cannot be used in the text patterns:
 * Percent signs
 * Colons
 * Brackets ( and  )
 * All matches are case insensitive
 * e.g.; "rune" will match for all of "RunE", "RUNeSSS", and "ERUNE"

The  modifier will tell the module to only add the specific category if all or part of the pagename matches the category name.
 * ::ifmatches

For example,  would add Category:Rune to Rune battleaxe or Off-hand rune battleaxe, but not to Adamant battleaxe.

The  modifier will tell the module to only add the specific category if all or part of the pagename matches the text passed.
 * ::ifmatches[text]

For example,  would add Category:Rune to Rune battleaxe or Adamant battleaxe, but not to Rune scimitar.

With, multiple match rules can be defined with multiple sets of brackets. For example,  will match any page that has either "rune" or "whip" in the title. In the rare cases where it may be necessary to have more than a few matches, they can be formatted with spaces and newlines. For example, the code below is acceptable:

The  will tell the module to remove the   argument from the beginning of pagenames to use as their sort key. If this function is not specified, then the category's name exactly will be used. Likewise, defining this function will not remove the category name from pages for sorting; however, it will still sort exact matches to the front.
 * ::remove[text]

For example,  would add Category:Burnt food to Burnt shark as.

If a pagename matches the text to remove exactly, then it will be sorted to the front.

The remove function can be suppressed by using a junk character (such as $). So  will not have a sort key when adding the category to Rune battleaxe. This will not suppress the front sort for exact title matches; e.g., the previous code will still add  to the page Rune.