Extension talk:CategoryTree/LQT Archive 1

=2008=

Problems with Colons in Categorynames
In German Wikipedia we have two toplevel Categories with a trailing Colon-Sign (":"). Categorytree.php seems to have problems to deal with colonsigns in the categoryname, but I think the idea of organizing categories in diffrent namespaces is valid und worthfull to support.

!Hauptkategorie [–] Vorlage: Probleme beim Laden der Daten. Bitte warte einen Moment und versuche es dann erneut. [–] Wikipedia: Probleme beim Laden der Daten. Bitte warte einen Moment und versuche es dann erneut. [–] Auszeichnung [+] Auszeichnungsart [+] Person nach Ehrung ..

Is it possbible to deal with such categories in a future release of the extension? In any other aspects this is a very usfull extension, many thanks for it. Kind regards, --Ollio 14:28, 6 January 2008 (UTC)


 * If this doesn't work, it'S a massive bug. Please report it on bugzilla so it doesn't get lost (there's a CategoryTree "component" there you can file it under). Sadly, I don'Ät have time now to look into it directly. Thanks -- Duesentrieb ⇌ 15:29, 6 January 2008 (UTC)


 * Is this problem already addressed or fixed in an upcoming release? -- BSDev 13:51, 2 December 2008 (UTC)

CategoryTree in Sidebar Clarification
I installed the js code from Extension:CategoryTree for inclusion of CatrgoryTree on the sidebar into common.js (not monotype.js which is reported as deprecated in my MW 1.10 installation), which displays a link to the CategoryTree page in the sidebar toolbox. This is fine, but I'd like to display the expandable CategoryTree itself in the sidebar, not a link to the CategoryTree page.

Can someone specify exactly how to do this in the sidebar? I now have the sidebar defaults:


 * navigation
 * mainpage|mainpage
 * portal-url|portal
 * currentevents-url|currentevents
 * recentchanges-url|recentchanges
 * randompage-url|randompage
 * helppage|help
 * http://meta.wikimedia.org/wiki/Help:Contents|User's Guide

Adding  , for example, gives a category tree rooted at Category:Top in the sidebar page view, but the tree doesn't appear in the sidebar itself. It doesn't matter where or how I place the parse function, with one or two asterisks or none. It's not a cache / refresh problem: I can add other parts and links w/ no problems. It appears that only links make it through to the sidebar, which seems to be part of the problem here.

The mod to function efCategoryTreeParserOutput in extensions/CategoryTree/CategoryTree.php seems to do nothing.

So, is this possible or is it wishful thinking?

--DJ 00:13, 18 January 2008 (UTC)


 * This requires a mod to MonoBook.php to enable normal wikitext in the sidebar, see Wikitext in side bar.
 * --DJ 19:23, 24 January 2008 (UTC)

I did all the required modifications and use in the sidebar, but there's still a problem with rendering. I get the tree's html source shown in the sidebar [–] Root ... and so on. Maybe i confused the sections of Monobook.php hmm? groovehunter 20:22, 21 February 2008 (UTC)


 * Have a look at following discussion. --WIKImaniac 12:49, 1 March 2008 (UTC)

"Error in my_thread_global_end: 1 threads didn't exit"

 * MediaWiki: 1.10.0
 * PHP: 5.2.5 (cgi-fcgi)
 * MySQL: 5.0.24-community-nt

I added CategoryTree so now the +/- signs appear and work. However, "Error in my_thread_global_end: 1 threads didn't exit" appears at the bottom of the page and as the last entry in most categories. What might cause this problem? --Fmmarianicolon 15:54, 21 January 2008 (UTC)


 * I have never heard of this error, it seems to be mysql related somehow. Not sure what aspect of the categorytree could trigger it, sorry. -- Duesentrieb ⇌ 16:29, 21 January 2008 (UTC)

Parser Function
I am using MediaWiki 1.11.0 with ParserFunctions v1.1 and ExtensionFunctions.php. Everything is recently installed within the last few days. Special:CategoryTree works perfectly, as does which shows up in Special:Version. Siebrand 00:04, 26 February 2008 (UTC)
 * The problem with hand-maintained version numbers in code, especially if edited by multiple people, is that often the code gets changed but the version number is not incremented. I feel that no version number is better than a misleading version number. -- Duesentrieb ⇌ 09:20, 26 February 2008 (UTC)
 * Feel free to add svn-keywords and use $Rev$ as a version ID. IIRC, before it did not have a version ID at all. Cheers! Siebrand 12:42, 26 February 2008 (UTC)
 * Ah, for some reason i thought keyword replacment was disabled on the repos. But i guess it was just decided not to used it for mediawiki. I have added it to CategoryTree, my other extensions will follow in time. -- Duesentrieb ⇌ 10:39, 27 February 2008 (UTC)
 * You did some interesting trickery with the string replacement in ExtensionCredits. I think I like that. Siebrand 13:40, 27 February 2008 (UTC)

Multiple Column parameter
This has been brought up before (above), but I couldn't find an answer. I used Extension:CategoryTree at this category. The tree now is one column. Is there a way to make the tree two columns (e.g., the parameter colls="#" would instruct the categorytree tag to lay it's contents over a number of columns)? If not, please add a parameter to Extension:CategoryTree to allow the CategoryTree to fall over two columns. Thanks. GregManninLB 16:29, 26 March 2008 (UTC)
 * I don't know how I would even begin to implement something like this. Or if i even understand what you are trying to do... -- Duesentrieb ⇌ 22:21, 9 April 2008 (UTC)

CategoryTree in other Namespaces
Can CategoryTree work in custom namespaces? The way we construct our wiki is through Book-> Chapter -> Section and we would like to use this to provide a dynamic Table of Contents. I just can't figure out how to use it on another namespace. Is there a variable you can enter to change the namepace for that call to the CategoryTree extension? If not, is this an enhancement planned for the future? Thanks, --Greg 17:05, 9 April 2008 (UTC)


 * Uh, categories live in the category namespace, per definition. I'm afraid I don't quite understandwhat you mean. For a dynamic table of content, perhaps Extension:Hierarchy or Extension:DynamicPageList will work better. -- Duesentrieb ⇌ 22:19, 9 April 2008 (UTC)

Thank you very much! That is exactly what I was wanting. --Greg 22:39, 9 April 2008 (UTC)

CategoryTree automatically open in the sidebar
I've install CategoryTree in my sidebar and it works great but when I go on a page throw the Tree, once the page open, the tree close itself. Is there a solution to keep it the way it was before clicking on it ? I've thinking about a solution which could solve the problem partially : when a page is open, a script looks in which category the page is and then it change the tag   to    Can you help me doing something like this ? Thank you for your extension, --Teriblus 15:57, 11 April 2008 (UTC)

I would like to second this request ... And I realise that this is not exactly easy to implement :-| -- Thoralf 13:04, 29 August 2008 (UTC)


 * This will not work for several reasons.
 * tags are evaluated server side, before anything is sent to the browser, so also before any JavaScript is evaluated.
 * pages may be in multiple categories
 * The first problem can be overcome by adding a feature to the extension code itself that will look which categories the current page is in. However, expanding the tree to appropriate depth is tricky, there may be several valid paths through the category structure, and for finding such a path multiple database queries are needed, which makes this extremely inefficient. And it would still not provide a solution to the second point.
 * It's important to keep in mind that a wiki's category structure often is not a tree - the tree view is a projection of the actual structure. Because of this, such a tree does not provide a location of each page: pages and even categories may show up in multiple places in the tree, there may even be loops. -- Duesentrieb ⇌ 14:05, 29 August 2008 (UTC)

Click the + has no effect in edit pages in the sidebar
Hi,

I installed the extention and make it works in the sidebar for all pages in the main namespace but I get the problem that clicking the + has no effect when I'm on a special page or when I'm editing a page...

Can you help me ? Thanks. --Teriblus 08:50, 7 May 2008 (UTC)

CategoryTree in Category pages
You know how the tree automatically is inserted in Category pages? It will only list Categories and subcategories. How do I make it list articles as well? Is there a template or something? thanks. —The preceding unsigned comment was added by 24.209.232.92 (talk • contribs) 19:00, 7 May 2008 (UTC). Please sign your posts with ~ !

$wgCategoryTreeCategoryPageMode = CT_MODE_ALL;

-- Duesentrieb ⇌ 20:06, 7 May 2008 (UTC)

Fatal Error and Wampserver?
Hi all, I have the latest version of MediaWiki running on Wampserver. When I try to use category tree, however, I get the following error message:

Fatal error: Call to undefined function wfLoadExtensionMessages in C:\wikidirectory\extensions\CategoryTree\CategoryTreeFunctions.php on line 405

This happens even if I disable all other extensions. Any ideas why? Does Wampserver not allow Ajax or something? Thanks for any help. Dwharrington 21 May 2008


 * your version of CategoryTree is incompatible with your (old) version of MediaWiki. Update mediawiki, or downgrade CategoryTree from svn. -- Duesentrieb ⇌ 14:33, 2 July 2008 (UTC)

depth="0" and onlyroot
onlyroot isn't the same as depth="0": only root means "show only the root, and the user can open the tree and see all the relvent catagories/pages (depends on mode)" while in depth="0" I can't see pages, only catagories, when using mode all. ערן 08:21, 4 July 2008 (UTC)
 * Works for me with the latest version of CategoryTree (checked with 36978, should work since 36864). In older versions, the depth parameter is quirky. What version are you using, exactly? -- Duesentrieb ⇌ 13:10, 4 July 2008 (UTC)
 * It didn't work properly few hours ago in Hebrew Wikipedia, but now it works fine. ערן 14:36, 4 July 2008 (UTC)
 * Oh... it has gone live... :) -- Duesentrieb ⇌ 19:12, 4 July 2008 (UTC)

Newfromrow function error
Hi. I have newly set extension for my wiki. I have uploaded to extensions directory and edited the Localsettings.php file enabled ajax etc. Well the problem is when I give mode=pages parameter it gives an error:

Fatal error: Call to undefined method Title::newfromrow in /home/content/wiki/extensions/CategoryTree/CategoryTreeFunctions.php on line 481

When I debugged the code I realized that there really isn't a function declaration of newfromrow.

On the other hand, if I don't use mode=pages parameter it works correctly.

How can I fix that?

Thank you. --6 July 2008


 * Don't use the latest version of CategoryTree unless you are also using the latest version of MediaWiki. If you use the latest *stable* version of MediaWiki (as you probably should), select 1.12.x on the download page -- Duesentrieb ⇌ 21:05, 6 July 2008 (UTC)

CategoryTree as a tree in SideBar
Hi folks. I’ve read all of this (include links) but still don’t understand how to integrate a CategoryTree in the sidebar not as a link (I know how to do that) but that it shows the tree.

Could someone explain it step by step or refer me to such explanation? I know maybe it looks stupid but I can’t read it now and again : (

Thank you. --Prosector 07:11, 18 July 2008 (UTC)


 * Three steps:
 * wait for MediaWiki 1.13 to be released
 * install the latest version of CategoryTree (after you have 1.13)
 * set $wgCategoryTreeSidebarRoot to the name of the category you want to use as a root for navigation.


 * The solutions presented above are more or less dirty hacks... I for one never got them to work :) -- Duesentrieb ⇌ 13:50, 18 July 2008 (UTC)

Thanks a lot Duesentrieb! I’ve already read about $wgCategoryTreeSidebarRoot but didn’t understand what did it mean. How to set it and where? --Prosector 17:44, 18 July 2008 (UTC)


 * You set it in LocalSettings.php - like all configuration. After including the extension. If your root category is called "Everything", you would use the following:
 * $wgCategoryTreeSidebarRoot = "Everything";
 * This will make all subcategories of Category:Everything show in the sidebar -- Duesentrieb ⇌ 08:05, 19 July 2008 (UTC)
 * Now I understand everything. Thanks again Duesentrieb! --Prosector 02:29, 20 July 2008 (UTC)

Conversion for an outline
Any suggestions on how to tweak this for use in an outline? For example, I have an outline that is 10 deep and a couple hundred long. It'd be nice to be able to have just the top level visible until someone clicks on the plus + next to it.

98.100.137.42 00:34, 25 July 2008 (UTC)


 * I assume that with "outline" you mean nested lists entered by hand on a single page. That is very different from a technical point of view, even if it looks similar. I don't see a good way to use CategoryTree for that. There are show/hide functions for html blocks used for the TOC -- perhaps look into how they are triggered, and try to recycle them (or copy & adopt). The respective HTML bit looks like this:

[hide]
 * I suggest to start digging there. -- Duesentrieb ⇌ 07:07, 25 July 2008 (UTC)

No [+] on category pages
I've done the install with default settings. If I use the tags or the special page it works. My category pages however do not have a [+] for sub categories. Any ideas? 210.1.210.137 12:05, 24 August 2008 (UTC)
 * No clue how that could happen. Got a link? -- Duesentrieb ⇌ 12:17, 24 August 2008 (UTC)
 * Have found out why. Somehow my wiki is reporting that it's the latest code but it isn't. The css wasn't being inserted. A wiki on a subdomain worked first go which gave me the clue. Thanks for the offer to help. 210.1.210.137 12:34, 24 August 2008 (UTC)

How to use CategoryTree directly on a category page?
Does anyone know how to use CategoryTree directly on a category page? In the Usage section, it says: CategoryTree can be used in three ways: directly on the category pages, as a custom tag, etc

Let's say I have a category called Model. Must I write in the Model category page? --27 August 2008


 * No. All subcategories shown on the page will have a clickable [+] automatically (like on wikipedia). If not, something is quite wrong :) -- Duesentrieb ⇌ 19:32, 27 August 2008 (UTC)

This works for me, but is not what I meant. If I open a category page, say http://www.mywiki.org/wiki/index.php?title=Category:MyTopCategory

then, without the CategoryTree-extension, all subcategories of MyTopCategory are listed automatically. I was hoping to replace this list with a clickable tree view, automatically, but I can't figure out how to. No tree view will be displayed without using the missing category appears on the page (example). --WIKImaniac 19:59, 6 January 2009 (UTC)