Help:Category: Difference between revisions

From Wikipedia of the Dark Brotherhood, an online Star Wars Club
(import from google cache)
(Adding nowiki tags)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<table style="background:transparent"><tr>
{{Help contents back}}
<td> [[Help:Contents|<img alt="" src="/code/images/thumb/8/8e/1leftarrow.png/16px-1leftarrow.png" width="16" height="16" border="0">]]
'''Categories''' are a software feature of MediaWiki, which enables pages to be added to automatic listings. These help structure a project such as DJBWiki by grouping together pages on similar subjects.
</td>
<td> <big>[[Help:Contents]]</big>
</td>
</tr></table>'''Categories''' are a software feature of MediaWiki, which enables pages to be added to automatic listings. These help structure a project such as DJBWiki by grouping together pages on similar subjects.






==  Putting pages in categories  ==
==  Putting pages in categories  ==
A page belongs to a category if the page's wikitext contains a declaration for that category. A category declaration takes the form [[Category:''Category name'']] or [[Category:''Category name''|''Sortkey'']]. The declaration must be processed, i.e. it will not work if it appears between &lt;nowiki&gt;...&lt;/nowiki&gt; or &lt;includeonly&gt;...&lt;/includeonly&gt; tags, or in a comment. The declaration may however come from a [http://en.wikipedia.org/wiki/Wikipedia:Transclusion transcluded] page.
A page belongs to a category if the page's wikitext contains a declaration for that category. A category declaration takes the form <nowiki>[[Category:''Category name'']]</nowiki> or <nowiki>[[Category:''Category name''|''Sortkey'']]</nowiki>. The declaration must be processed, i.e. it will not work if it appears between &lt;nowiki&gt;...&lt;/nowiki&gt; or &lt;includeonly&gt;...&lt;/includeonly&gt; tags, or in a comment. The declaration may however come from a [http://en.wikipedia.org/wiki/Wikipedia:Transclusion transcluded] page.


In DJBWiki, it is customary to place category declarations at the end of the wikitext.
In DJBWiki, it is customary to place category declarations at the end of the wikitext.
Line 18: Line 14:


==  Sort keys  ==
==  Sort keys  ==
All articles in a given category are sorted alphabetically. If you want an article to be sorted by something other than its name, you should use the following link form in the article's text: [[Category:''Example''|''Sort key'']] (where ''Example'' is the category name, and ''Sort key'' is the value to sort the list by).
All articles in a given category are sorted alphabetically. If you want an article to be sorted by something other than its name, you should use the following link form in the article's text: <nowiki>[[Category:''Example''|''Sort key'']]</nowiki> (where ''Example'' is the category name, and ''Sort key'' is the value to sort the list by).


For example, by default, the article [[Sith Bloodfyre]] will be listed under the character's first name, "S", because it is the first letter of the article's name. You could instead force the article to be listed by the character's last name ("Bloodfyre, Sith") by using the string [[Category:DJB Characters|Bloodfyre, Sith]].
For example, by default, the article [[Sith Bloodfyre]] will be listed under the character's first name, "S", because it is the first letter of the article's name. You could instead force the article to be listed by the character's last name ("Bloodfyre, Sith") by using the string <nowiki>[[Category:DJB Characters|Bloodfyre, Sith]]</nowiki>.


Remember that sort keys are case sensitive, with capital letters being sorted before lowercase letters. Therefore, ''Bloodfyre, Sith'' would appear in the list before ''bed''.
Remember that sort keys are case sensitive, with capital letters being sorted before lowercase letters. Therefore, ''Bloodfyre, Sith'' would appear in the list before ''bed''.
Line 27: Line 23:


==  Linking to a category  ==
==  Linking to a category  ==
To link to a category page ''without'' putting the current page in that category, precede the link with a colon: [[:Category:Category name]].
To link to a category page ''without'' putting the current page in that category, precede the link with a colon: <nowiki>[[:Category:Category name]]</nowiki>.
 
 


==  Category Policy  ==
==  Category Policy  ==

Latest revision as of 16:40, 1 April 2024

Help:Contents

Categories are a software feature of MediaWiki, which enables pages to be added to automatic listings. These help structure a project such as DJBWiki by grouping together pages on similar subjects.


Putting pages in categories

A page belongs to a category if the page's wikitext contains a declaration for that category. A category declaration takes the form [[Category:''Category name'']] or [[Category:''Category name''|''Sortkey'']]. The declaration must be processed, i.e. it will not work if it appears between <nowiki>...</nowiki> or <includeonly>...</includeonly> tags, or in a comment. The declaration may however come from a transcluded page.

In DJBWiki, it is customary to place category declarations at the end of the wikitext.

When a page has been added to one or more categories, a categories box appears at the bottom of the page. This box contains a list of the categories the page belongs to, in the order in which the category declarations appear in the processed wikitext. The category names are linked to the corresponding category pages. They appear as redlinks if no category page currently exists.


Sort keys

All articles in a given category are sorted alphabetically. If you want an article to be sorted by something other than its name, you should use the following link form in the article's text: [[Category:''Example''|''Sort key'']] (where Example is the category name, and Sort key is the value to sort the list by).

For example, by default, the article Sith Bloodfyre will be listed under the character's first name, "S", because it is the first letter of the article's name. You could instead force the article to be listed by the character's last name ("Bloodfyre, Sith") by using the string [[Category:DJB Characters|Bloodfyre, Sith]].

Remember that sort keys are case sensitive, with capital letters being sorted before lowercase letters. Therefore, Bloodfyre, Sith would appear in the list before bed.


Linking to a category

To link to a category page without putting the current page in that category, precede the link with a colon: [[:Category:Category name]].

Category Policy

The Wiki Tribune has decided that categories must contain at least ten in order to exist on DJBWiki.