Creating a category hierarchy in a MediaWiki environment

11,023

Solution 1

You can use the special page Special:Categories to show the list of all categories on a wiki.

But if you want a better structure, I think you should also create a hierarchical structure from your categories (like Wikipedia does starting with Category:Contents). That way, your users will be able to navigate not just articles in the same category, they will also be able get to similar categories.

Solution 2

I'm not sure if this is as automatic as you'd like, but you can add a category tag to the article for a Category, and it'll become a subcategory of sorts. For example, go to the article "Category:Foo", edit it, and add [[Category:Bar]]. When you then visit Category:Bar, it'll list Foo as a subdirectory.

For example, see this page on wikipedia, which has this category as a subcategory, which itself has subcategories.

Solution 3

Once your category tree has grown you can use Special:UncategorizedCategories to make sure all categories (apart from one) are in at least one subcategory. Similarly you can use Special:UncategorizedPages to make sure all of your pages live in at least one category.

Share:
11,023
Admin
Author by

Admin

Updated on June 14, 2022

Comments

  • Admin
    Admin almost 2 years

    Background:

    I work with a large collaboration which centralizes a lot of documentation in a wiki structure. I have passing familiarity with wiki-markup and can create simple pages with links, etc.

    One major deficiency of my collaboration's wiki (based on mediawiki architecture) is that there is very little organization or cross-linkage.

    I'm attempting to introduce a hierarchical category structure to the wiki, such that pages are broken down into categories, providing a means of interlinking information.

    I know that I can add a [[Category:THISCATEGORY]] tag to any page source, and a special category page which organizes other pages with that category is automatically generated. The major advantage of this method of linking pages is that one gets access to related pages for free (so long as they are tagged), without requiring direct cross linkage between pages explicitly.

    Question:

    I'm wondering, is there an efficient way to create a root-category node of some kind, which instead of linking to other pages, links to all categories? This would allow the wiki to be effectively cross-linked without major overhauls, and would only require that a page author provide some general category tags for any additional pages they might wish to add.

  • Admin
    Admin over 11 years
    Thanks! This is exactly the starting place I wanted. Now, I can see what I've got, and how to better organize it. You're just plain awesome.
  • Admin
    Admin over 11 years
    Thanks very much. This is related to what I want to do.