Template:Category handler

From Wikidata
Jump to: navigation, search
Documentation icon Template documentation[view] [edit] [history] [purge]

This is the {{Category handler}} meta-template.

It helps other templates to automate both categorization and category suppression.

Already when used with its default settings this template prevents auto-categorization in some namespaces and on some pages where we usually don't want categorization. Thus even the most basic usage like "{{category handler|[[Category:Somecat]]}}" sees to that templates don't auto-categorize in the wrong places.

This template makes it easy to choose in what namespaces a template should and should not categorize. And it makes it easy to use different categories in different namespaces. And this template uses a central blacklist where we can add pages and page types where templates should not auto-categorize.

When not to use this template[edit]

If a template only needs to categorize in one of the namespaces main (articles), file (images) or category, then using this template is overkill. Then instead use one of {{Main other}}, {{File other}}, or {{Category other}}. But if your template needs to categorize in any other namespace, then we recommend you use this template, since it provides proper category suppression and makes it easy to select how to categorize in the different namespaces.

Namespaces[edit]

This template detects and groups all the different namespaces used on Wikidata into several types. These types are used as parameter names in this template.

main = Main/article space, as in normal Wikidata pages.
talk = Any talk space, such as page names that start with "Talk:", "User talk:", "File talk:" and so on.
user, wikidata, file, mediawiki, template, help, category = The other namespaces except the talk pages.
other = Any namespaces that were not specified as a parameter to the template. See examples below.

Technical details[edit]

The centralised category suppression blacklist is in the sub-template {{Category handler/blacklist}}. To see or update the blacklist, go there.

For its internal parameter processing, this template uses the sub-template {{Category handler/numbered}}.

More info[edit]

For more info on this template please see this page