Template:Cat: Difference between revisions

From Zelda Dungeon Wiki
Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
(Created page with "<includeonly>{{#vardefine:TarCat|{{#ifeq:{{#explode:{{#vardefineecho:cat|{{{1|}}}}}|\|1}}|{{Void}}|{{#var:cat}}|{{#explode:{{#var:cat}}|\|0}} in {{Zelda|{{#explode:{{#var:cat}}|\...")
 
(Making this usable for us.)
Line 1: Line 1:
<includeonly>{{#vardefine:TarCat|{{#ifeq:{{#explode:{{#vardefineecho:cat|{{{1|}}}}}|\|1}}|{{Void}}|{{#var:cat}}|{{#explode:{{#var:cat}}|\|0}} in {{Zelda|{{#explode:{{#var:cat}}|\|1}}}}}}}}{{#ifeq:{{{2|}}}|~|[[:Category:{{#var:TarCat}}|{{{3|{{#var:TarCat}}}}}]]|[[Category:{{#var:TarCat}}|{{#switch:{{{2|}}}|{{Void}}={{PAGENAME}}|PAGENAME={{PAGENAME}}|AutoTitle={{#replace:{{#replace:{{PAGENAME}}|the|}}|The|}}|#default={{{2|}}}}}]]}}</includeonly><noinclude>
<includeonly>[[Category:{{{1}}}|{{{2|{{PAGENAME}}}}}]]</includeonly><noinclude>
==Purpose==
==Purpose==
Use this template to easily categorize a page or link to a category.
This template is used for categorizing pages.  
==Usage==
==Usage==
For categorizing with this template, type: {{NoWikiTemp|Optional|Category|Sorting Key}}
To use this template, type: <b><nowiki>{{Cat|</nowiki></b><i> Category </i><b><nowiki>|</nowiki></b><i> Sorting Key </i> (Optional)<b><nowiki>}}</nowiki></b><br>
* '''''Category''''' — The desired category.
Where ''Category'' is the name of the category you want to sort a page into, and ''Sorting Key'' is an optional parameter if you want to change how a page is sorted. If you leave ''Sorting Key'' blank, it'll automatically sort the page correctly into the category.
* '''''Sorting Key''''' — What you wish to sort the page by in the category. The more descriptive you are with it, the better sorted the page will be. If left blank the template will automatically sort the page by its name, without any leading prefix.
[[Category:Formatting Templates|{{PAGENAME}}]]
 
For Linking to a category with this template, type: {{NoWikiTemp|Optional|Category|~|Alternate Name}}
* '''''Category''''' — The desired category.
* '''''~''''' — Type just that, a single tilde "~". Anything else will make it categorize instead. Works under the assumption that no one will use "~" as a sorting key.
* '''''Alternate Name''''' — If you wish to have the link say something other than the category name.
 
'''Note:''' For tedious category names, such as "''Enemies in The Legend of Zelda: Ocarina of Time''", you may also instead enter "''Enemies\OoT''" as the category name and it will link properly to the correct category.
{{Cat|Formatting Templates}}
</noinclude>
</noinclude>

Revision as of 15:49, October 16, 2011

Purpose

This template is used for categorizing pages.

Usage

To use this template, type: {{Cat| Category | Sorting Key (Optional)}}
Where Category is the name of the category you want to sort a page into, and Sorting Key is an optional parameter if you want to change how a page is sorted. If you leave Sorting Key blank, it'll automatically sort the page correctly into the category.