Topic on Project:Support desk

Jump to navigation Jump to search

How to Show All Categories in CategoryTree Without a "Root" Category?

Summary by Johnywhy

Not possible.

You must have a "root" category to show all categories in the wiki.

Example: create a category called "TOC".

Add all other category pages to the TOC category, thus making them subcategories.

Now the following will list all categories:


You can use the hideroot option to hide the TOC root in the rendered Tree:

Johnywhy (talkcontribs)


Seems all syntax requires the admin manually type a "root" category.


But my wiki doesn't have a "root" category and subcategories-- it just has a collection of categories.

How to show all categories, without typing a "root" category?

Might be here, unsure: Extension:CategoryTree#Using MediaWiki: namespace pages

This returns nothing:

{{#categorytree:{{root category}}}} 
Bawolff (talkcontribs)

you don't need a specific "root" category. You just need a category for the category tree extension to start at. It can be any category

Johnywhy (talkcontribs)

so, if i want to show, in the TOC, all pages and categories on the entire wiki, then i would a need root category.



Bawolff (talkcontribs)

If you just want to just list all categories in the wiki, you can use {{special:AllPages/Category:}}

Its mathamatically impossible to turn an arbitrary graph into a tree without a starting point.

Johnywhy (talkcontribs)

True. That will show "Category:" prefix next to each category.

You can also do the following, which will not show "Category:" prefix next to each category.


However, neither of these is concerned with the CategoryTree extension. Neither provides a collapsible tree, neither shows pages.