Extension talk:CategoryTree

From MediaWiki.org
Jump to: navigation, search
Start a new discussion
First page
First page
Previous page
Previous page
Last page
Last page

<categorytree> in Special pages

After installing CategoryTree (Mediawiki 1.23) on my Special pages, I am seeing <categorytree> as a link. Anyone know how to fix this? The extension is working fine other than that.

Kmacdowe (talk)22:32, 7 November 2014

This means that MediaWiki:Categorytree is missing though this is pretty strange. I have seen this on the Wiki of the Free Software Foundation, too. Probably some other extension you installed does not play with the CategoryTree extension.

[[kgh]] (talk)18:59, 8 November 2014

Thanks kgh. It is installed, and the tag works on my regular pages so this isn't a show stopper but it is odd. Thanks for the help.

Kmacdowe (talk)03:50, 11 November 2014
 
 

Permissions issue using version c7333ea on mediawiki 1.23

I've an issue with some users with restricted (read only) access being unable to expand any node, seeing the tree wherever it is rendered, but getting a load failure, try again later message whatever node they try to expand.

I suspect it is an incompatibility with my own extension Extension:NSWhitelist but haven't been able to figure out what, yet.

I've ruled out browser issues, and a user with full rights can use it fine. Can someone tell me what user rights are needed to expand a node? Must you be able to read a particular namespace?

Hoggle42 (talk)10:31, 31 October 2014

Have narrowed it down to a read permission issue - whitelistread is not sufficient for this url:

index.php?skin=vector&
uselang=en&
debug=true&
action=ajax&
rs=efCategoryTreeAjaxWrapper&
rsargs%5B%5D=Customer_Pages&
rsargs%5B1%5D%5Bmode%5D=10&
rsargs%5B1%5D%5Bhideprefix%5D=20&
rsargs%5B1%5D%5Bshowcount%5D=true&
rsargs%5B1%5D%5Bnamespaces%5D%5B%5D=12&
rsargs%5B1%5D%5Bnamespaces%5D%5B%5D=14&
rsargs%5B1%5D%5Bnamespaces%5D%5B%5D=100&
rsargs%5B%5D=json

The user has read access to the three indicated namespaces, but without a title there appears to be no way to grant access to this url

Hoggle42 (talk)13:48, 31 October 2014

ajax dispatcher checks

( !User::isEveryoneAllowed( 'read' ) && !$wgUser->isAllowed( 'read' ) )

and throws an error if this is not the case - this means the TitleReadWhitelist is not checked, as no reference to the title is given.

So, if the user does not have global read access, they can't use categorytree.

hacked the core code to be (bad fix)

( !User::isEveryoneAllowed( 'read' ) && !$wgUser->isAllowed( 'read' )  && !$this->func_name == 'efCategoryTreeAjaxWrapper')
Hoggle42 (talk)14:16, 31 October 2014

Does userCan( 'read' ) work any better?

Nemo13:37, 1 November 2014

that's a title method - no title in the request.

The problem is that titlereadwhitelist gives permissions on a per-title basis (in this case to user groups) and the ajax request only cares about the user's global permissions. I could use canRead if the request included a title.

Hoggle42 (talk)09:26, 3 November 2014
 
 
 
 

{{FULLPAGENAME}} in Category Tree

Hey there!

I wanted to make a template taking some work from me adding the category tree the category pages. It looks like this:

<categorytree>{{FULLPAGENAME}}</categorytree>


Sense behind that was to just add the template without having the need to type in the whole category:xy-thing.

Do you have an idea why it doesn´t work?


Thanks and best regards!

80.110.21.14713:47, 10 September 2014

force categorytree to update when add new page.

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?

Siggiae (talk)02:53, 27 August 2014

I too would like a solution to this.

130.242.58.3607:59, 5 September 2014
 

Do not show the page you are on

Could a new attribute be implemented that would allow the current page you are on to be not shown in the list? For example, if there are 10 pages in a category and you are on one of them (it's opened), only nine pages would be shown in the list as the page you are on (that is opened) would not be shown. Sometimes it's useless to list the page you are on, if you are already on it.

Hartz (talk)17:37, 2 September 2014

The attribute could be for example: except=current.

Hartz (talk)17:41, 2 September 2014
 

How to keep CategoryTree stayed opened after clicking any category in sidebar in Vector skin?

When I am going down in one category and subcategories (depth 5-6), after loading the specified category and then hitting the "back" button on the browser , the category tree is folded again. Is there any chance the tree stays opened? Please reply ASAP... How to keep nodes expaneded even after clicking back button in browser.Any code changes to be done in Categorytree extension? It would be great to have the tree expanded to the current page after clicking any article , so that the users can get a quick impression about the location of the current article in the overall context.

Satyamcompany (talk)21:30, 25 April 2013

iam also facing same problem.., any solution??

14.140.124.6913:18, 17 December 2013

Hi, I did a small dev to offer this feature to everybody. Please refer to "CategoryTree in Sidebar stayed opened". Do not hesitate to comment :-)

Cornucopia (talk)11:48, 20 February 2014

Hi,

I can't get it to work. Is it all to just copy the JavaScript to ext.categoryTree.js ?

5.2.127.1015:04, 24 February 2014

Hi, in the version of CategoryTree I am using, it is not the file ext.categoryTree.js but the file CategoryTree.js.

Be sure you are using a similar version of CategoryTree else you may need to merge my modifications.

FYI, sometimes it does not work with recent IE due to the default compatibility mode set to a "too old" IE version (the IE "intranet mode" can also introduce such "too old" IE version). Tell me if it solves your issue. Best Regards

Cornucopia (talk)15:48, 24 February 2014

Hi, I am porting my patch to Mediawiki 1.22.2 and the related CategoryTree extension. I keep you in touch. Best regards.

Cornucopia (talk)19:37, 25 February 2014
 
 
 
 
 

Output a category tree anywhere in the skin

Edited by 2 users.
Last edit: 09:09, 6 June 2014

Hi all! I'm designing a skin, and I want to include a category tree in the footer. I'm trying to figure out the code necessary to output it, by I've been failing for hours. The problem is always the same: the tag gets parsed, but the ext.CategoryTree.js is not loaded, so the JavaScript is never run and the tree doesn't work. Below are some of my attempts, but none worked. They were all within the skin template class, which extends BaseTemplate. Thanks!

echo efCategoryTreeParserHook( 'Some category', array( 'mode' => 'all' ) );
$parser = new Parser();
echo efCategoryTreeParserHook( 'Some category', array( 'mode' => 'all' ), $parser );
$title = $this->getTitle();
$parser = new Parser();
$parserOptions = new ParserOptions();
$parserOutput = $parser->parse( '<CategoryTree mode=all>Some category</CategoryTree>', $title, $parserOptions );
echo $parserOutput->getText();
LFS (talk)22:45, 13 May 2014

CategoryTree in SideBar with HideRoot set to true

I changed the file "CategoryTreeFunctions.php" to the following:

if ( !$hideroot ) {
				$html .= $this->renderNode( $title, $depth, $wgCategoryTreeDynamicTag );
			} elseif ( $hideroot or !$wgCategoryTreeDynamicTag ) {
				$html .= $this->renderChildren( $title, $depth );
			} else {
				$uniq += 1;
				$load = 'ct-' . $uniq . '-' . mt_rand( 1, 100000 );
 
				$html .= Xml::openElement( 'script', array( 'type' => 'text/javascript', 'id' => $load ) );
				$html .= 'categoryTreeLoadChildren("' . Xml::escapeJsString( $title->getDBkey() ) . '", '
						. $this->getOptionsAsJsStructure( $depth )
						. ', document.getElementById("' . $load . '").parentNode);';
				$html .= Xml::closeElement( 'script' );
			}

I added "$hideroot or" part. Don't know if this will have unwanted side affects in regular pages, but it does fix the problem of the Categories not displaying when hideroot is set to false.

108.35.111.6812:05, 1 June 2014

Upgraded to 1.22.6 & category tree not working

I have upgraded my wiki to 1.22.6 and downloaded the latest version of CategoryTree, I get this error:

"3d6d0149] 2014-05-16 13:07:35: Fatal exception of type MWException

Notice: Uncommitted DB writes (transaction from DatabaseBase::query (MessageBlobStore::clear)). in /home/wiki_op/website/mediawiki-1.22.6/includes/db/Database.php on line 3944"

Should there be DB updates for this version?

Thanks, Ailsa

AilsaNapier (talk)13:31, 16 May 2014

initial expanded categorytree tags

Until last year the categorytree-tag was initially expanded when I used wikitext like this: <categorytree mode=pages showcount="on" >Category:Tag_extensions</categorytree> . (=>

Tag extensions(571 P)

)

Since January, the tags are displayed collapsed. But I want to show the expanded version.

Boshomi (talk)13:43, 11 January 2014

The new default to collapsed didn't satisfact my needs either. Any workaround available?

Lugusto (talk)02:34, 14 February 2014
Tag extensions(571 P)
121.15.105.7703:49, 12 May 2014
 
 

[+] Dissapear when expand

Hi I have problem with CategoryTree extension. When expand a category the [+] signal dissapear. Help please!!!

187.60.192.214:05, 30 April 2014

Custom pictograms for expanded and collapsed nodes

Hi! I searched in CategoryTreeFunctions.php and .js and .css files but failed to find where may I change what is displayed near the category name. I want to replace [+] and [-] with my own pictograms because such text signs look a little bit poorly. Thank You for any help and clues.

78.30.116.22415:26, 25 April 2014

Hi, I suggest you to have a look to my home page where I describe a solution User:Cornucopia#Tips:_Change_collapse.2Fexpand.2Fempty_images_in_the_CategoryTree. Then, simply change the png with your own images : )

Cornucopia (talk)21:38, 25 April 2014

Thanks, thats what I've been looking for, but You do not say where to put that code. Could You specify the file I need to modify? Thanks.

78.30.95.22816:25, 26 April 2014

Hi, heading title names are the wiki page names to create :-) Br

Cornucopia (talk)15:55, 27 April 2014
 
 
 

Reasonable Expectation for $wgCategoryTreeCategoryPageOptions

Here's my setup:

Product Version
MediaWiki 1.20.3 (r264)
PHP 5.3.3 (apache2handler)
MySQL 5.1.67

I was trying to get Pages under a Subcategory to display in a Categories view. I tried the following in LocalSettings.php:

$wgCategoryTreeCategoryPageOptions['mode'] = CT_MODE_ALL;
$wgCategoryTreeSpecialPageOptions['mode'] = CT_MODE_ALL;

and

 
$wgCategoryTreeCategoryPageOptions['mode'] = 'all';                                                                                       
$wgCategoryTreeSpecialPageOptions['mode'] = 'all';

but these had no effect.

It took going into extensions/CategoryTree/CategoryTree.php and changing NULL to CT_MODE_ALL:

$wgCategoryTreeDefaultOptions['mode'] = CT_MODE_ALL; # will be set to $wgCategoryTreeDefaultMode in efCategoryTree(); compatibility quirk
...
$wgCategoryTreeCategoryPageOptions['mode'] = CT_MODE_ALL; # will be set to $wgCategoryTreeDefaultMode in efCategoryTree(); compatibility quirk

for the behavior to change.

The documentation doesn't give any examples or make any assertions for $wgCategoryTreeCategoryPageOptions['mode'],

options to use on category pages

Has anyone else had any success with $wgCategoryTreeCategoryPageOptions['mode'] in LocalSettings.php?

Zacharysyoung (talk)22:31, 10 January 2014

Are you adding after require_once("{$IP}/extensions/CategoryTree/CategoryTree.php");?

Ancap (talk)10:36, 21 April 2014
 

"depth" parameter not working with pages

Hello, I have only a small hierarchy and I would like that the categorytree is initially fully expanded including pages and possibly subpages. Because of this I use the "depth" parameter.

Here an example of the following hierarchy: main_category->programming_category->ada_page
main_category->programming_category->c_page
<categorytree hideroot="on" mode="pages" depth="5">main_category</categorytree>

But the cateory tree only initially shows the categories, i.e. "programming_category" The pages are not shown initially. But if I manually click on the "+" left to "programming_category" then the pages are shown.

What do I have to do to initially expand "pages/subpages"? Why is the depth parameter only relating to categories and not to pages?

I'm using a 1.19 mediawiki and the latest stable version of the categorytree extension.

Thank you.

Best regards,
Dirk

Dirk 80 (talk)09:34, 17 December 2012

+1. A configuration setting that allows you to collapse/expand subpages would be very useful!

Cavila (MW 1.19.2, MySQL 5.1.66, Php 5.3.3-7, SMW 1.8, SF 1.5.2}11:45, 3 June 2013
 

Hi,

Did you get this working?

202.67.4.11307:10, 6 December 2013
 

Set $wgCategoryTreeMaxDepth[ CT_MODE_PAGES ] = 5; in your LocalSettings.php

LFS (talk)02:18, 24 March 2014
 

memorize opened in tree categories

It became necessary to store(or memorize?) opened in tree categories and after move to another page we should open those categories. Other words - we are opening several categories in the tree, then we click several times at various articles and we should see the tree in the same form (those several categories should be still opened).

What the easiest way to do it? Big thx for help!



PS: sorry for my pure english

217.28.218.12212:22, 23 May 2012

categorytree is always dynamic, I don't think that's possible.

Nemo18:39, 28 September 2012

Hi, I did a small dev to offer this feature to everybody. Please refer to "CategoryTree in Sidebar stayed opened". Do not hesitate to comment :-)

Cornucopia (talk)08:37, 21 February 2014
 
 

categorytree not working in templates

I am trying to use category tree in a template and it's not working. If I use this version:

I get nothing (nothing is displayed on the page).

If I use this version:

Category Extension talk:CategoryTree/categorytree not working in templates not found

I get an italic line that says "Category XXXX not found".

If, however, I hard code the subpage name in the template (which defeats the purpose of the template) it works fine.

Here's the template in its entirety:

Category Extension talk:CategoryTree/categorytree not working in templates not found
66.178.130.20915:52, 25 January 2014

Sorry, it won't let me edit the above to fix the formatting issues.

66.178.130.20916:38, 25 January 2014

Interesting.... Apparently restarting apache is not enough to get categories to show up in a template. My LAMP server reboots early Sunday AM (this morning) and now the categories show up correctly. I have no idea why a reboot might be necessary, but before the reboot I'd get a "Category XXX not found" and now I get the category tree.

66.178.130.20916:16, 26 January 2014
 
 

setting mode does not work as desired

Hi, Mediawiki 1.19.9

I set up mode = pages and mode = all. But the category tree does not display the pages, but only displays the categories within the tree. Is there a way for the category tree to display the pages within the category?

Thanks Arnab

81.247.85.6219:41, 7 January 2014

Broken?[edit | edit source]

Hi, the categorytree in idwp is broken.

Category Pengguna yang diminta untuk diblok not found

used to work in id:WP:PPP#Pemblokiran and elsewhere, but now it didn't. I will crossposting a bug, if no one has reported it yet.

Bennylin (talk)08:53, 22 January 2014
 

Javascript error loading the tree in the sidebar

I have the extension working, and have now the config:

$wgUseAjax = true;
require_once( "$IP/extensions/CategoryTree/CategoryTree.php" );
$wgCategoryTreeDynamicTag = true;
$wgCategoryTreeSidebarRoot = '[my top level category]';
$wgCategoryTreeForceHeaders = true;

When loaded the in-page tree loads fine, the categories heading appears for the portlet, but nothing else. The javascript console reports that categoryTreeloadChildren is undefined.

Using 1.21 on Chrome

any help appreciated

Hoggle42 (talk)15:29, 19 November 2013

I have submitted a bug report to MediaWiki.

Bamyers99 (talk)00:16, 11 January 2014
 

Unable to maintain tree state, collapses every time

Edited by another user.
Last edit: 17:06, 8 January 2014

Hi Daniel,

This extension is very useful for maintaining tree structure for categories and iam using it in sidebar. But i have issue with maintaining tree state in multiple clicks or on clicking front/back buttons of browser, as of now it is collapsing every time to its initial state. Is it possible to maintain its state like the navigation in sidebar for SEARCH, TOOLBOX of mediawiki, please help...

Thanks.

14.140.124.6906:58, 8 January 2014

Fatal error CategoryTreePage.php

I just upgraded to mediawiki 1.19.9 . The CategoryTree extension for 1.19 gives the following error Fatal error: Call to undefined method SpecialPage::specialpage() CategoryTreePage.php on line 27

Any idea how to fix this one? Does it work with 1.19.9 or should I have to downgrade? If so, which version of mediawiki does it perfectly work with?

81.247.89.21612:44, 15 November 2013

okay, sorry, I had loads of versions of CategoryTree and this one was a wrong version. The 1.19 version of CategoryTree works perfectly goood.

81.247.89.21612:05, 16 November 2013
 
First page
First page
Previous page
Previous page
Last page
Last page