Editing
Template:Ctg/doc
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation}} {{Invokes|Category handler}} 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 <code><nowiki>[[Category:<category>| ]]</nowiki></code>, 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|'''Ruby''' amulet]] will be sorted into [[:Category:Ruby]] as <code><nowiki>[[Category:Ruby|Amulet]]</nowiki></code> ** Subpages are handled similarly; e.g. [[Slayer/Level up table|'''Slayer'''/Level up table]] will be sorted as <code><nowiki>[[Category:Slayer|Level up table]]</nowiki></code> 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 <pre> {{Ctg|Category 1|Category 2|...}} </pre> ;Example: <pre> {{Ctg|Rune|Mining}} </pre> Placed on most pages, this would produce :<code><nowiki>[[Category:Rune]][[Category:Mining]]</nowiki></code>. On the page [[Mining]], however, it would produce :<code><nowiki>[[Category:Rune]][[Category:Mining| ]]</nowiki></code>. On [[Rune battleaxe]], it would produce :<code><nowiki>[[Category:Rune|Battleaxe]][[Category:Mining]]</nowiki></code> ==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 (<code>%</code>) :# Colons (<code>:</code>) :# Brackets (<code>[</code> and <code>]</code>) :All matches are '''case insensitive''' ::e.g.; "rune" will match for all of "RunE", "RUNeSSS", and "ERUNE" ---- ;<nowiki>::ifmatches</nowiki> The <code>::ifmatches</code> modifier will tell the module to only add the specific category if all or part of the pagename matches the category name. For example, <code><nowiki>{{ctg|Rune::ifmatches}}</nowiki></code> would add [[:Category:Rune]] to [[Rune battleaxe]] or [[Rune scimitar]], but not to [[Adamant battleaxe]]. ;<nowiki>::ifmatches[text]</nowiki> The <code>::ifmatches[text]</code> modifier will tell the module to only add the specific category if all or part of the pagename matches the text passed. For example, <code><nowiki>{{ctg|Rune::ifmatches[battleaxe]}}</nowiki></code> would add [[:Category:Rune]] to [[Rune battleaxe]] or [[Adamant battleaxe]], but not to [[Rune scimitar]]. With <code>::ifmatches</code>, multiple match rules can be defined with multiple sets of brackets. For example, <code>::ifmatches[rune][whip]</code> 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: <pre> {{ctg|Food::ifmatches[shark] [tuna] [apple] [orange] [burnt] [raw] [cooked] }} </pre> ;<nowiki>::remove[text]</nowiki> The <code>::remove[text]</code> will tell the module to remove the <code>text</code> 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. For example, <code><nowiki>{{ctg|Burnt food::remove[burnt]}}</nowiki></code> would add [[:Category:Burnt food]] to [[Burnt shark]] as <code><nowiki>[[Category:Burnt food|Shark]]</nowiki></code>. 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 <code><nowiki>{{ctg|Rune::remove[$]}}</nowiki></code> 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 <code><nowiki>[[Category:Rune| ]]</nowiki></code> to the page [[Rune]]. <includeonly>[[Category:Maintenance templates]]</includeonly>
Summary:
Please note that all contributions to OtherX may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
OtherX:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Ctg
(
edit
)
Template:Documentation
(
edit
)
Template:Invokes
(
edit
)
Module:Array
(
edit
)
Module:DPLlua
(
edit
)
Module:DependencyList
(
edit
)
Module:Documentation
(
edit
)
Module:Paramtest
(
edit
)
Module:Tooltip
(
edit
)
Module:Yesno
(
edit
)
This page is a member of a hidden category:
Category:Pages with broken file links
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Template
Discussion
English
Views
Read
Edit source
View history
More
Purge cache
Search
Discord
Discord
Navigation
Main page
About us
Random page
Otherside
Legends of the Mara
Otherside Trips
Otherside Test Events
LOTM Guides & Info
Basics Guide
Hunting Guide
Farming Guide
Enchanting Guide
Game Updates
Oda Information
Quick References
Koda Weapons
Oda Abilities Table
Oda Stats Table
Tools
What links here
Related changes
Special pages
Page information
Page values