Help:Categorising pages

From Deskthority Wiki
Jump to navigationJump to search

Categorisation of wiki pages makes them more accessible by allowing pages to be found easily through site navigation. Categories function a lot like "tags" in other websites, in that a page can be placed into as many different categories as you desire. By clicking the category names at the bottom of a page, you can explore related pages through browsing the category contents.

The MediaWiki category syntax is rather odd and tricky to remember.

Categorising a page[edit source]

To categorise a page, write the category name as a link:

[[Category:IBM keyboards]]

Confusingly, this syntax does not create a link; instead, it places the page into the specified category!

Also bear in mind that categorisation cannot be checked by edit preview; to verify that the category exists as expected, temporary convert it to a link (see section below) and make sure that the category link shows up in blue/purple instead of red. Then remove the colon from the category "tag" before saving your changes.

Category "tags" can occur anywhere on the page, including inside any template; for example, the template invocation {{stub}} adds [[Category:Stubs]] to the page at the point where {{stub}} is written (usually at the top of the page) along with the visible message that the page is a stub. Conventionally, the list of categories is placed at the bottom of the page, one per line.

Linking to a category[edit source]

To link to a category, add a colon to the beginning of the name:

[[:Category:IBM keyboards]]

This produces a link as follows:

Category:IBM keyboards

To avoid having "Category:" show up as part of the link text, add a pipe to the end of the name (i.e. set the display text to the empty string):

[[:Category:IBM keyboards|]]

When saving the page, this will automatically expand out, and be saved, as follows:

[[:Category:IBM keyboards|IBM keyboards]]

This required redundancy is an unfortunate limitation of the way MediaWiki was designed.