Extension talk:CategoryTree

Jump to: navigation, search

About this board


1 (2006/2007) - 2 (2008) - 3 (2009) - 4 (2010) - 5 (2011)

By clicking "Add topic", you agree to our Terms of Use and agree to irrevocably release your text under the CC BY-SA 3.0 License and GFDL (talkcontribs)


I've added the CategoryTree for the sidebar and changed its position via adding *categorytree-portlet, I'm wondering though if you can have sublinks and include this in a regular category like the following (at MediaWiki:Sidebar;


* Example Heading

** categorytree-portlet

** another link



or changing the categorytree-portlet to "Example Heading" and including links after this by;


* categorytree-portlet

** another link



Is there any way to do either one of these?

Thanks in advance!

Best regards,


Reply to "Sidebar with sublinks" (talkcontribs)


I'm wondering if it's possible to use this addon for subpages rather than categories, such as subpages in a custom namespace, much like the extension Extension:SubPageList, although included in this extension. This because it would allow me to unly use one extension for both and also not having to implement the javascript needed for collapsing page lists.

Best regards,


Reply to "Using for subpages"

force categorytree to update when add new page.

Siggiae (talkcontribs)

I am invoking categorytree with the syntax {{#categorytree:Embryo|mode=pages|showcount|depth=2 etc. When I create a new page and add it to the category Embryo, categorytree will not list the new page. I can close/open the page that invoked categorytree, login again with no effect. If I look directly at the page Category:Embryo the new member page is listed immediately. The only way I can get the {{#categorytree:Embryo etc to update is to resave the page where it occurs. Same behavior if I use the tag syntax.

There must be a better way, I thought this function was dynamic. No obvious warnings of this behavior on the relevant help page or in discussions. Suggestions? (talkcontribs)

I'm also seeing this. shouldn't it populate the tree automaticly? (talkcontribs)

yes it should make the tree grow even tho right not my tree isnt growing

SmartK (talkcontribs)

We would also like to know if there is a "fix" for this. I have noticed that updates of pages and categories are shown in categorytree with a long time difference. Maybe we have to run some kind of job to update the database in the background? I can reproduce this with mediawiki 1.27.0.

Reply to "force categorytree to update when add new page."

Count is correct but only gray arrows are shown in sidebar

User71649 (talkcontribs)

Mediawiki 1.26.2

Try to get this working in my Sidebar using the default Vector skin.

The number of sub-pages and subcategories are correct but only a gray arrow is shown and so I can't traverse the category tree.

Interesting, for categories that have their own sub-categories, the arrow is completely gone!

Here are my  LocalSettings.php parameters:

$wgUseAjax = true;

require_once "$IP/extensions/CategoryTree/CategoryTree.php";

$wgCategoryTreeSidebarRoot = "Category:Sidebar";

$wgCategoryTreeSidebarOptions['showcount'] = true;

User71649 (talkcontribs)

I can confirm the problem exists in a fresh installation of MediaWiki 1.26.2 installed from the bitnami MAMPstack + MediaWiki. (talkcontribs)

I have the same problem with MediaWiki 1.26.2 and the last CategoryTree code from git

User71649 (talkcontribs)

I've reverted to Medaiwiki 1.23.13 and the problem is absent.

A little surprised that the 6th top download extension (according to Special:ExtensionDistributor) can be incompatible with the latest mediawiki version that is almost 5 months old now.

I think I'm going to stick to the LTS versions of mediawiki from now on. (talkcontribs)

Se the topic above. Replacing "$content.find" with "$" in ext.categoryTree.js (to places) seems to fix the problem in MediaWiki 1.26.

Reply to "Count is correct but only gray arrows are shown in sidebar"
NicolasEcarnot (talkcontribs)


Using MediaWiki 1.26.3 and CategoryTree 2016-01-09T22:52:17, I'm using it in the sidebar with $wgCategoryTreeSidebarRoot = "myRootCategory";

I'm quite happy with that but when clicking on the blue arrows, nothing is happening.

I read the doc and tried the workarounds, but to no avail.

I'm not using redirects or short URLs.

Our setup is very simple and common.

Is there something I could try?

Thanks for your help.

Mhausi (talkcontribs)

this works for me: fix sidebar in MW (talkcontribs)

Brilliant! Replacing "$content.find" with "$" in ext.categoryTree.js (to places) seems to work perfectly in MediaWiki 1.26 as well.

Will someone fix this in the CategoryTree distribution?

Reply to "Unable to expand arrows in sidebar"

Setting more than one attribute not working

Stoettner (talkcontribs)


when setting

<categorytree mode=pages hideprefix=always>Root</categorytree>

the result considers only the first attribute mode=pages.

What is the correct syntax for setting more than one attribute?

many thanks,


Kghbln (talkcontribs)

I can imaging that

<categorytree mode="pages" hideprefix="always">Root</categorytree>

might do the trick. Not tested this though. Perhaps one cannot add more that one option which would be sad. Did not use this so far.

Stoettner (talkcontribs)

Sadly not working. Instead using

$wgCategoryTreeOmitNamespace = true;

to globally disable NS rendering in categories. Can't believe that an extension with such broad usage is not allowing this.

Kghbln (talkcontribs)

Ah, yeah, this would have been too easy. I just saw on the docu that newer versions should probably use

$wgCategoryTreeDefaultOptions['hideprefix'] = true;

Not to mention that the docu is rather a disaster. :( Anyways, glad it works.

Well, if WMF does not have a usecase or sees the need the chances are pretty low that we will be getting something like this via the tag.

Reply to "Setting more than one attribute not working"

Customized collapse/expand/empty images broken after update

Rbirmann (talkcontribs)


I am having an issue with this extension after upgrading MW from 1.22 to 1.26. I have also updated my CategoryTree extension from whatever version I had installed a couple of years ago to the latest available version, so I am not sure to which of these upgrades my issue is related.

In our wiki, back in MW 1.22 and the old CT version, we had changed the color of the category tree bullets by changing MediaWiki:categorytree-collapse-bullet, MediaWiki:categorytree-expand-bullet and MediaWiki:categorytree-empty-bullet to something like this:

<span style="color:#ffd15a;">▼</span>

This was working fine, but now, in MW 1.26 with the latest CT version, if I click on a ► bullet to expand the category tree, the clicked bullet is replaced by:

<span style="color:#ffd15a;">▼</span>

... as if the contents of MediaWiki:categorytree-collapse-bullet were enclosed in <nowiki> tags.

Is this intentional behaviour? Or is it a bug?

Either way, how can I change the color (or content) of the bullets in the latest CategoryTree version?

Maybe (just thinking out loud here), editing MediaWiki:Common.css and adding a CategoryTreeToggle style definition there? Haven't tried this...

Thanks in advance (talkcontribs)

just started working on a mediawiki site and had issues with the CategoryTree 1.26 extension. I ended up using an older version (I used 1.23). My issue with the 1.26 CategoryTree extension was it hid all of the WYSIWG buttons for the wiki editor.

I did change the color of my triangles. The CSS looks different than yours in my version of CategoryTree. The triangle element had a class surrounded it, so it was easy to target. Hope that helps (talkcontribs)

I never ment to do this. I can take full blame and I do. You are really a wonderful person who works hard. in all forms and thats respectable by all individuals I will vouch for you and push people who are against you to think twice. I know i put u down. I really dragged a lot of people down so dont feel to discouraged. I wasnt even that happy when we were dating. the last year was when i was losing confidence. It was so strange we were dating to me. I knew it wouldnt last forever. The fact that we lastest two years was supper and i thought well two years means forever. I quickly now understand things dont get to last forever. unless you take drugs and thats just got to hurt you in the butt. well not all the time. i thought taking a bottle of this concerta was going to kill me today but instead i discovered this new tree and that i want inside

Reply to "Customized collapse/expand/empty images broken after update"

Insert CategoryTree right of Content?

AmazingTrans (talkcontribs)

How can i insert the categoryTree to the right of the Contents box? Also, can i encapsulate the categoryTree in a box like the Content? (talkcontribs)

yeah, just put it inside a div. so, surround the code calling for the category tree with something like

<div style="float:right; display:block; brackground-color:grey; border:1px solid black">

category tree coding


Meriware (talkcontribs)

Hrm. That appears to lose the toggles to contract / expand the tree.

Reply to "Insert CategoryTree right of Content?"

CategoryTree menu disappeared

Summary by Tacsipacsi

The problem was with another extension.

Castroblop (talkcontribs)

When I upgrade to Mediawiki 1.26.2, CategoryTree disappeared from bottom of edit page. Where previously there were drop-down menus of parent-child-grandchild categories, there is only now the parent category and a orphan category. Do you know how this can be solved?? My LocalSettings.php for CategoryTree

require_once( "$IP/extensions/CategoryTree/CategoryTree.php" );
$wgUseAjax = true;
$wgCategoryTreeDefaultOptions['mode'] = 'all';

And the wiki is running

  • MediaWiki 1.26.2
  • PHP 5.5.9-1ubuntu4.14
  • MySQL 5.5.47-0ubuntu0.14.04.1
  • Vector skin
  • CategoryTree (11fd8ec)

Here is an example of how the CategoryTree menu now looks http://beyond-social.org/wiki/images/7/7b/SelectCategory-edit.png thanks a

Tacsipacsi (talkcontribs)

I don't know why does it work at all, I don't see any configuration turning it on (if the wiki is beyond-social.org). The documentation says nothing that these variables should do this, neither see I anything in the MediaWiki namespace. If you speak about another wiki, what is that? Making it publicly editable (at least in some namespaces) for a few days would help me to debug.

Castroblop (talkcontribs)

I confused CategoryTree with SelectCategory. Apologies

Jeffatcw (talkcontribs)

At least for the purposes of my site, it would be better to have the articles for a category listed before the subcategories so that you have the following:

Category name

article 1

article 2

> Subcategory 1 name

> Subcategory 2 name

and then when you expand a subcategory, you get the articles in that subcategory listed before it's subcategories, etc.

If this is doable, I can't see it. Can it be done?

Jeffatcw (talkcontribs)

Of course, when I say "article", I use it to mean the same as "page".

Reply to "A more logical sort order"