Difference between revisions of "Help:Categories"

From BRL-CAD
m (1 revision(s))
m (1 revision(s))
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 +
{{PD Help Page}}
 +
 +
MediaWiki allows you to categorize pages by adding one or more category tags to the text.  Adding these tags create links at the bottom of the article which take you to the list of all pages in that category, which makes it easy to browse related articles.
 +
 +
== How to add categories ==
 +
 
To add an article to a category put the following at the end of the page you are editing...
 
To add an article to a category put the following at the end of the page you are editing...
  
  <nowiki>[[Category:{Name}]]</nowiki>
+
  <nowiki>[[Category:NAME]]</nowiki>
  
where {Name} is the name of the category you want to add it to.  Any number of category tags may be added to the page - the page will be listed in all of them.
+
where NAME is the name of the category you want to add it to.  Any number of category tags may be added to the page - the page will be listed in all of them.
  
You can also specify an additional {Sort} parameter that dictates where the page will appear, alphabetically, within the category. This is achieved by using the following markup:
+
You can also specify an additional SORT parameter that dictates where the page will appear, alphabetically, within the category. This is achieved by using the following markup:
  
  <nowiki>[[Category:{Name}|{Sort}]]</nowiki>
+
  <nowiki>[[Category:NAME|SORT]]</nowiki>
  
 
So for example, to add this page to the 'Help' category, you would use:
 
So for example, to add this page to the 'Help' category, you would use:
Line 13: Line 19:
 
  <nowiki>[[Category:Help|Categories]]</nowiki>
 
  <nowiki>[[Category:Help|Categories]]</nowiki>
  
Note that we used 'Categories' as the sort parameter.  Without this the page would be listed under 'H' for 'Help:Categories', instead of under 'C', which is more useful.  Other situations where you might want to use the sort parameter is when you have articles about people that are titled as <code>FirstName LastName</code> but within the category you want them listed as <code>LastName, FirstName</code>.
+
Note that we used 'Categories' as the sort parameter.  Without this the page would be listed under 'H' for 'Help:Categories', instead of under 'C', which is more useful.  Other situations where you might want to use the sort parameter is when you have articles about people that are titled as <code>FirstName LastName</code> but within the category you want them listed as <code>LastName, FirstName</code>.
 +
 
 +
Another way to sort the article in the correct letter without the namespace is
 +
 
 +
<nowiki>[[Category:Help|{{SUBPAGENAME}}]]</nowiki>
 +
 
 +
This is extremely helpful when using templates which include a category tag. ...
 +
 
 +
''Note: the SORT parameter does '''not''' affect how the page title is displayed within the category listing, just how it is ordered.  In the above example, the link to this page will still be 'Help:Categories', and not 'Categories' as you might expect!''
 +
 
 +
== Linking to Category Pages ==
 +
 
 +
To create a link to a category page:
 +
 
 +
<nowiki>[[:Category:NAME]]</nowiki>
 +
 
 +
If you were linking to the Category Page for Help on MediaWiki, the link would look like this: [[:Category:Help]]
 +
 
 +
If you want to display alternate text for the link:
 +
 
 +
<nowiki>[[:Category:NAME|TEXT]]</nowiki>
 +
 
 +
Here is an example of the same link to the Category Page for Help on MediaWiki as above, but with alternative text: [[:Category:Help|MediaWiki Help Index]]
 +
 
 +
== Categorize Categories==
 +
 
 +
Categories themselves and other uploaded files like Pictures can be categorized exactly like normal pages. It is useful to connect the article-categories with categories already in place to establish connections and hierarchies. To this end, after saving the article, follow the category links at the end of the page to see, if the category is already in place and if not, categorize them until you connect them with an existing category.
 +
 
 +
==Moving categories==
 +
Categories cannot be easily moved [[Help:Moving a page|like other pages]]. For this reason, category names should be chosen carefully.
 +
 
 +
The easiest way (for those with admin privileges) is to create the new page, delete the old one, and then change the tags in each member of the category (manually or with a bot). However, this loses the page history - not a huge problem when categories are used only for navigation, but when a wiki is structured differently and the category pages contain significant amounts of text, this is undesirable.
 +
 
 +
=== Moving with revision history ===
 +
However, category pages ''can'' be moved together with the full revision history, with some effort, by using the [[Special:Export]] and [[Special:Import]] functions.
 +
 
 +
A fuller guide, with additional steps and reference to using [[meta:category.py|category.py]] is given at [[Appropedia:Project:Moving category pages]].
  
''Note: the {sort} parameter does '''not''' affect how the page title is displayed within the category listing, just how it is ordered.  In the above example, the link to this page will still be 'Help:Categories', and not 'Categories' as you might expect!''
+
==See also==
 +
* [[Meta:Help:Category]]
  
 +
{{Languages|Help:Categories}}
 
[[Category:Help|Categories]]
 
[[Category:Help|Categories]]
 +
[[Category:Category| ]]

Latest revision as of 21:15, 24 April 2008

PD
Important note: When you edit this page, you agree to release your contribution into the public domain. If you don't want this or can't do this because of license restrictions, please don't edit. This page is one of the Public Domain Help Pages, which can be freely copied into fresh wiki installations and/or distributed with MediaWiki software; see Help:Contents for an overview of all pages.


MediaWiki allows you to categorize pages by adding one or more category tags to the text. Adding these tags create links at the bottom of the article which take you to the list of all pages in that category, which makes it easy to browse related articles.

How to add categories[edit]

To add an article to a category put the following at the end of the page you are editing...

[[Category:NAME]]

where NAME is the name of the category you want to add it to. Any number of category tags may be added to the page - the page will be listed in all of them.

You can also specify an additional SORT parameter that dictates where the page will appear, alphabetically, within the category. This is achieved by using the following markup:

[[Category:NAME|SORT]]

So for example, to add this page to the 'Help' category, you would use:

[[Category:Help|Categories]]

Note that we used 'Categories' as the sort parameter. Without this the page would be listed under 'H' for 'Help:Categories', instead of under 'C', which is more useful. Other situations where you might want to use the sort parameter is when you have articles about people that are titled as FirstName LastName but within the category you want them listed as LastName, FirstName.

Another way to sort the article in the correct letter without the namespace is

[[Category:Help|{{SUBPAGENAME}}]]

This is extremely helpful when using templates which include a category tag. ...

Note: the SORT parameter does not affect how the page title is displayed within the category listing, just how it is ordered. In the above example, the link to this page will still be 'Help:Categories', and not 'Categories' as you might expect!

Linking to Category Pages[edit]

To create a link to a category page:

[[:Category:NAME]]

If you were linking to the Category Page for Help on MediaWiki, the link would look like this: Category:Help

If you want to display alternate text for the link:

[[:Category:NAME|TEXT]]

Here is an example of the same link to the Category Page for Help on MediaWiki as above, but with alternative text: MediaWiki Help Index

Categorize Categories[edit]

Categories themselves and other uploaded files like Pictures can be categorized exactly like normal pages. It is useful to connect the article-categories with categories already in place to establish connections and hierarchies. To this end, after saving the article, follow the category links at the end of the page to see, if the category is already in place and if not, categorize them until you connect them with an existing category.

Moving categories[edit]

Categories cannot be easily moved like other pages. For this reason, category names should be chosen carefully.

The easiest way (for those with admin privileges) is to create the new page, delete the old one, and then change the tags in each member of the category (manually or with a bot). However, this loses the page history - not a huge problem when categories are used only for navigation, but when a wiki is structured differently and the category pages contain significant amounts of text, this is undesirable.

Moving with revision history[edit]

However, category pages can be moved together with the full revision history, with some effort, by using the Special:Export and Special:Import functions.

A fuller guide, with additional steps and reference to using category.py is given at Appropedia:Project:Moving category pages.

See also[edit]