Help:Categories: Difference between revisions

No edit summary
Line 34: Line 34:
First: do you need to create one? Sometimes a category very similar to the one you are about to create already exists. Search [[Special:Categories]] for similar categories.
First: do you need to create one? Sometimes a category very similar to the one you are about to create already exists. Search [[Special:Categories]] for similar categories.


'''If you do not find a similar category or still want to give a page a more specific label:'''  
'''If you do not find a similar category or want to add another categorization:'''  
 


<big>To create a category just type</big>
<big>To create a category just type</big>
Line 47: Line 48:




<big>'''Please, do not create categories like this'''</big>  
<big>'''Please do not create categories like this'''</big>  
<pre><nowiki>[[</nowiki>Category:Category/Name<nowiki>]]</nowiki></pre>
<pre><nowiki>[[</nowiki>Category:Category/Name<nowiki>]]</nowiki></pre>


Line 64: Line 65:
A red category link indicates that its page has not been created. A blue category link indicates that a page for that category exists.  
A red category link indicates that its page has not been created. A blue category link indicates that a page for that category exists.  


Categories are most powerful when included within templates. Let's look at the Spam template as an example. When a page is flagged with the spam template <nowiki>{{</nowiki>[[Template:Spam|Spam]]<nowiki>}}</nowiki>, that page is automatically filed in the [[Category:Spam|Spam category]] because it is declared within the template.


When you create a template, include the category within the <nowiki><</nowiki>includeonly<nowiki>></nowiki> tags <nowiki>[[</nowiki>Category:Category_name<nowiki>]]</nowiki>.
==Using Categories with Templates==
If you want to add another category or a category that doesn't need a template just add <nowiki>[[</nowiki>Category:Category_name<nowiki>]]</nowiki> to the page.
Categories are most powerful when included within templates. Let's look at the Spam template as an example.
 
When a page is flagged with the spam template <nowiki>{{</nowiki>[[Template:Spam|Spam]]<nowiki>}}</nowiki> it is automatically filed in the [[Category:Spam|Spam category]]. How? When an editor creates or edits a template, they can add a category to it just like any content page. Once a category has been added to a template, whenever that template is invoked it's member categories are as well.
 
===How to Add a Category to a Template===
When creating a template, just include the category within the <nowiki><</nowiki>includeonly<nowiki>></nowiki> tags:
 
<pre>
<nowiki><</nowiki>includeonly<nowiki>></nowiki>
<nowiki>[[</nowiki>Category:Category_name<nowiki>]]</nowiki>
<nowiki>[[</nowiki>Category:Another_category_name<nowiki>]]</nowiki>
<nowiki><</nowiki>includeonly<nowiki>></nowiki>
</pre>
 


==Category Pages==
==Category Pages==
Line 75: Line 88:
Category pages should only include:
Category pages should only include:


;a brief definition
;a brief definition :What does this category mean?


;its purpose
;its purpose :Why was this category created?


;an example
;an example :Provide a link to a page that provides good context of when to implement the category


=How to Add an Existing Category=
=How to Add an Existing Category=
Confirmed users, Bureaucrats and Sysops emeriti
176

edits