CatCatGrouping is a MediaWiki extension.
Status for Mediawiki4Intranet distribution:
Intended for more sensible grouping of pages on category pages — pages having more than one categories will be listed grouped by other categories and not the first letter.
Can be switched on via adding of magic word to the category page.
Can be switched on globally via $wgCategorySubcategorizedList = true; in LocalSettings.php. Then you’ll be able to turn it off via magic word.
magic word will force linear page listing for category when being put on its page.
Also you can disable column lists globally for categories with less than X pages via $wgMinUncatPagesList = X; in LocalSettings.php.
First install CategoryTree, then add the following into your LocalSettings.php: