Difference between revisions of "Template:Cat"

From Zelda Dungeon Wiki
Jump to navigation Jump to search
(add 'extra')
(sortkey can only take 255 characters so it's not feasible to allow arbitrary 'extra' data. adding 'group' to replace it.)
Line 1: Line 1:
<includeonly>{{#ifeq:{{{nocat}}}|true||[[Category:{{{1}}}|{{{2|{{PAGENAME}}}}}{{#if:{{{extra|}}}|{{!}}{{{extra}}}}}]]}}</includeonly><noinclude>
+
<includeonly>{{#ifeq:{{{nocat}}}|true||[[Category:{{{1}}}|{{{2|{{PAGENAME}}}}}{{#if:{{{group|}}}|{{!}}{{{group}}}}}{{#if:{{{extra|}}}|{{!}}{{{extra}}}}}]]}}</includeonly><noinclude>
 
{{Documentation}}
 
{{Documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 02:12, June 26, 2020

[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>}}