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}}|\...")
 
No edit summary
(7 intermediate revisions by 3 users not shown)
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>{{#ifeq:{{{nocat}}}|true||[[Category:{{{1}}}|{{{2|{{PAGENAME}}}}}]]}}</includeonly><noinclude>
==Purpose==
{{Documentation}}
Use this template to easily categorize a page or link to a category.
==Usage==
For categorizing with this template, type: {{NoWikiTemp|Optional|Category|Sorting Key}}
* '''''Category''''' — The desired 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.
 
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 18:01, September 10, 2014

[Edit Documentation]

size=40x40px This template is used on over 2500 pages. Take extra care when making changes, testing them in a sandbox first. If changes to this template require changes to pages that use it, you are responsible for making those changes.

This template is used for categorizing pages.

Usage

{{Cat| category | sort key | group= }}

  • category — The name of the category you want to sort a page into
  • sort key — Optional parameter if you want to change how a page is sorted. If you leave sort key blank, it'll automatically sort the page correctly into the category. (Optional. Default: {{PAGENAME}})
  • group — Sort the page into the given group in {{Navboxes}}. (Optional.)

Advanced Usage

When used in templates to automatically apply a category to certain pages, some may be excluded by using {{Cat| category | nocat=true }}. For example, to exclude the template itself from the category:

{{Cat|Category<noinclude>|nocat=true</noinclude>}}