Last modified: 2008-04-28 20:25:30 UTC
Can there be made an option for the categorytree tag to hide te Category-prefix. In bug 8011 there is committed a patch to make this possible, but only if a configuration variable is set. Maybe it can be named 'hideprefix', just like the 'hideroot' option.
in theory, it would be possible. However, it is not as trivial as it sounds - it's yet another option that needs to be passed through the various calls, and needs to be taken into account when calculating cache keys. I thought about doing it, but decided against it for now - I would like to have a nice and clean way to handle options without having to change the paramater lists of various functions, think about cache keys, URL parameters, etc, every time. If someone comes up with a nice solution for this - excellent :)
Why not member variables of an object?
That would be a little bit better, but not much. Especially, it doesn't eliminate the need to manually adopt the ajax calls for each new possible option, and adop the backend function efCategoryTreeAjaxWrapper; the cache key issue also remains. All this is not rocket science, it can be done. But i'm reluctant to add anything new this way, because i'd rather have a nice and clean mechanism for dealing with new options flexible. Other (future) ajax-based extensions would probably also benefit from that.
Maybe you can place the category-prefix in a span with a class, so it can be hidden by css.
Created attachment 4844 [details] CategoryTreeFunctions.php
Created attachment 4845 [details] CategoryTree.php Added $wgCategoryTreeOmitCatNS to initialized config vars.
Enabled a new config var, to let you choose whether to display Category: prefix when mode=pages or all. Making this available as a global config option saves the trouble of finding a fix for this on the individual level.