Using Categories
A Guide to Using MediaWiki in a Hosted Environment
An instructional website by the developer of mh370wiki.net - a MediaWiki site about Malaysia Airlines Flight MH370.
Categories, a software feature of MediaWiki, provide automatic indexes that are useful as tables of contents.
You can categorise pages and files by adding one or more Category tags to the content text. These tags create links at the bottom of the page that take you to the list of all pages in that category, which makes it easy to browse related articles.
Source: Help:Categories
Common Syntax
Add a page to a Category: For example, this page has been added to the parent category Use. The text is usually placed at the end of a page, but location is not significant.
[[Category:Use]]
Link to a Category Page: The additional colon, shown below, prevents the current page from being added to the category page. For example
[[:Category:Secure|Secure]]
Sort Order: Include a pipe symbol | followed by a value. This is demonstrated by the sort order of level one categories such as Install, Configure, Customise etc. Each page has been added to the Top Level category, with a numeric sort order, like this:-
[[Category:Processes|1]]
Categories and mh370wiki.net
The mh370wiki.net website has grown in size over the past decade and a persistent challenge has been 'how to implement Categories'.
A focus on the label Category can lead to questions like: How is a page categorised? By topic? By document type (report, statement, transcript)? By source (country, department, organisation, person)?
Alternatively, a focus on the word Tag leads to an association with usage on social media: a person is 'tagged' in a photo. A Tag implies a mention of something. Wordpress uses both Categories and Tags, where topics can be organised in Categories, and keywords are listed as Tags.
The MediaWiki source Help:Categories is intended for users and explains what a category is, how to create a new category, and how to link to a category page, but not 'how to design a category structure'.
In Tools --> Special Pages and the section Maintenance reports there are several items related to categories:-
- Uncategorised categories
- Uncategorised files
- Uncategorised pages
- Uncategorised templates
- Unused categories
- Wanted categories
The implication is that every page, file and template should belong to a category. In practice I think a realistic goal would be to ensure that every page in the Main namespace and any other namespace accessible to a public user should belong to a category. Some ideas about a category structure follow:-
Category Structure
- Start with a single Top-Level category for the site.
- Categories and their subcategories form a hierarchy which can be represented as a tree - see the Extension:CategoryTree
- Ensure that each category is a subcategory of only one parent category.
- Every page should belong to at least one category. I would call this a Primary Category and it would likely relate to the page Topic.
- Pages can 'belong' to more than one category. I could call these Secondary Categories and would likely relate to keywords (tags) within the page content.
Hidden Categories
Categories can be 'hidden'. This is useful for administrative purposes. I use hidden categories named by task, for example To Do or Add Content or Update SEO. If I see a problem with a page but don't have time to fix it, I add it to one of these hidden categories so I can find and fix the issue later.
To hide a category (it will remain visible to logged in users) add the magic word __HIDDENCAT__ to the category page.
Category Paging Limit
There were 227 passengers onboard Malaysia Airlines flight MH370. Each passenger page was added to the category Passengers by Name. But when displaying a list of Passengers by Name, the list was (initially) incomplete.
MediaWiki has a default limit for items in a category = 200. See Manual:$wgCategoryPagingLimit.
The solution required adding a line to LocalSettings.php
# Increase limit on category pages. Default was 200 $wgCategoryPagingLimit = 250;
Links
- Help:Categories
- https://www.mediawiki.org/wiki/Help:Categories
- Manual:$wgCategoryPagingLimit
- https://www.mediawiki.org/wiki/Manual:%24wgCategoryPagingLimit