Extension talk:CategoryTree

Jump to: navigation, search

About this board

Archives 

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

Change CategoryTree's position in sidebar

2
35.1.151.198 (talkcontribs)

I included a category tree in the sidebar by using <code>$wgCategoryTreeSidebarRoot = "mRootCategory"</code>. However, the category tree only shows at the bottom of the sidebar. Is there any way to move it up?

47.19.147.162 (talkcontribs)

Same problem. Below I see some changes were done to fix this problem in ext.categoryTree.js, but it's still not working. I tried to use different skin, samething.

Reply to "Change CategoryTree's position in sidebar"

Don't run like I would, expandable don't work.

1
81.184.42.86 (talkcontribs)

Hello,

I install the extension, but when i put <categorytree>Index</categorytree>, the result pages show me the category index, but without the expandable system, only shows a list like special:Caegorytree....

Please help-

Thanks

Guindelo

Reply to "Don't run like I would, expandable don't work."
Paul Hema (talkcontribs)

Moin moin.

The CategoryTree didn't find any subcategories. I hope the following image will show the problem:

While clicking "Erosion durch Wasser" (see the image) the correct pages an the subcategory appears.

Paul

Tacsipacsi (talkcontribs)

On which wiki did this occur? Is it persistent (have you tried it again as it told)?

Paul Hema (talkcontribs)

1.27.1

There are no changes when reloaded

Tacsipacsi (talkcontribs)

I meant can you give a URL for debugging?

Paul Hema (talkcontribs)

no sorry. It's under construction yet.

The CategoryTree version is

Paul Hema (talkcontribs)

I have updated the wiki from version 1.24. Maybe there is an old stuff of the previous version?

Tacsipacsi (talkcontribs)

Then please check your browser console. It can usually be accessed with the F12 key and/or Ctrl+Shift+I (if you can't find it, write me what browser you use and I try to find it out).

Tacsipacsi (talkcontribs)

If it's under construction, can't you delete the whole wiki and install the most recent versions with a clean installation?

Paul Hema (talkcontribs)
{"error":{"code":"readapidenied","info":"You need read permission to use this module","docref":"See https://fbs01/MethodenWiki/api.php for API usage"}}

The given link throws a 500 error.

Paul Hema (talkcontribs)

Oops. Here is the cmd answer:

What's wrong?

Tacsipacsi (talkcontribs)

The web error message says that you don't have read permission through the API (while you obviously have through the normal HTML interface). This can be somehow CategoryTree's code error if your wiki's private (i.e. anonymous users can't read pages). It was designed for Wikipedia, where read access is not a problem. The command line error is OK, api.php isn't designed for command line access (it wants to access $_SERVER which I think is an empty array or something like that). For development, you can set $wgShowExceptionDetails = true; in LocalSettings.php (it's not recommended for production use!), although it won't produce any error message in this case, since it's not an error in PHP level.

Paul Hema (talkcontribs)

Ok, it is a private wiki. So it can be a code error in CategoryTree. I think i have to live with this problem.

Thanks

Tacsipacsi (talkcontribs)

No, the developers should fix it. I reported here.

Ciencia Al Poder (talkcontribs)

Maybe you're using Extension:LockDown? (would be a dupe of task T148582 in that case)

Reply to "problem while loading data"
NicolasEcarnot (talkcontribs)

Hello,

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

130.226.230.2 (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?

85.84.143.206 (talkcontribs)

Thanks!!!

Reply to "Unable to expand arrows in sidebar"

Fix for making CategoryTree work in sidebar again with MW 1.24.1 and Vector skin

4
Bhuber (talkcontribs)

Hi all, I used to offer a CategoryTree in my MediaWiki sidebar with MW 1.20.4. Everything worked well, but since my update to MW 1.24.1 all appropriate releases of CategoryTree stopped working in the sidebar. This includes the REL1_24 version but also the development master version. The problem is, that the expandable symbols are not shown at all and no click handle is registered. Interestingly CategoryTree works perfect as part of a WikiPage in parallel to not work at all in the sidebar.

I figured out that the way how the ext.CategoryTree.js works is that it uses a mw.hook to access the WikiPage content and to make CategoryTree working there. But obviously the sidebar is not part of the content which is access by this approach. I tested it by just removing the whole content in the ext.CategoryTree.js and literally just the inner section of my page disappeared but the sidebar was still there together with some other navigation content. So I am looking for a fix to have ext.CategroyTree.js to access the whole content including the sidebar.

I am no MediaWiki nor js nor php specialist, but after looking into the vector skin, I figured out how the skin accesses the whole content. I decided to give this appraoch a try, so I modified the beginning of ext.CategoryTree.js (which is located in extensions/CategoryTree/modules by the way) to make it look like this:

//( function ( $, mw ) {
//
//   mw.hook( 'wikipage.content' ).add( function ( $content ) {
jQuery( function ( $ ) {
               /**
                * Sets display inline to tree toggle
                */
               function showToggles() {

and the end of ext.CategoryTree.js to look like this;

        // Register click events and show toggle buttons
        $( '.CategoryTreeToggle' ).click( handleNode );
        showToggles();
   } );
 
//}( jQuery, mediaWiki ) );

From my understanding this gives the ext.CategoryTree.js access to the whole page content. So good news is, that everything works well after this modification, CategoryTree in the sidebar works like expected.

So now I have a question to all MediaWiki specialists: is this a valid approach to solve the problem? Or does it cause tremendous load to the system or break system concepts?

David6243 (talkcontribs)

I think a crucial change is missing from the js code you posted, something like:

jQuery( function ( $ ) { var $fullcontent = $(this);

And later, access fullcontent instead of content, e.g.

function showToggles() { $fullcontent.find( 'span.CategoryTreeToggle' ).css( 'display', 'inline' ); }

Anyway, the hints about the sidebar not being part of the content and looking at vector.js for reference were very helpful to me, and I can now show a category tree anywhere in the skin. Thanks!

As for your question: Don't know. I haven't noticed any problems.

Also, sorry about editing the subject of your post. Initially, I couldn't respond because of this:

This page can only be edited by users with the autoconfirmed right because it matches the following title blacklist entry: .*Make.*cat.* autoconfirmed

By now, my account is confirmed. Changing the subject hadn't helped either.

Bhuber (talkcontribs)

David,

you are absolutely right, for some weird reason I missed to add two really important changes...

Generally speaking, you want to replace any use of the term $content.find by a single $, which refers to the whole DOM from my understanding. This needs to happen two time in the ext.categoryTree.js:

               function showToggles() {
                       $content.find( 'span.CategoryTreeToggle' ).css( 'display', 'inline' );
               }

needs to be modified to look like this:

               function showToggles() {
                       $( 'span.CategoryTreeToggle' ).css( 'display', 'inline' );
               }

and

               // Register click events and show toggle buttons
               $content.find( '.CategoryTreeToggle' ).click( handleNode );
               showToggles();

needs to be modified to look like this:

               // Register click events and show toggle buttons
               $( '.CategoryTreeToggle' ).click( handleNode );
               showToggles();

So there is absolutely no need to search or build another $content var, obviously you can work on the whole DOM like the skin sample does.

PS: There is absolutely no need to excuse for making my post usable to you and others by doing whatever is required...

85.84.143.206 (talkcontribs)

Brilliant !! Many Thanks !

Reply to "Fix for making CategoryTree work in sidebar again with MW 1.24.1 and Vector skin"

force categorytree to update when add new page.

9
Summary by Sarise298
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?

91.192.31.192 (talkcontribs)

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

178.251.183.178 (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.

79.122.187.86 (talkcontribs)

I confirm the issue too. MW 1.27.1

Dturtill (talkcontribs)

i also have this@Sarise

Dturtill (talkcontribs)

There is a possible temp fix for this if you disable Caching for your wiki then they change instantly to do this add the following at the bottom of your LocalSettings.php file.

$wgEnableParserCache = false; $wgCachePages = false;

This comment was hidden by FDMS4 (history)
Reply to "force categorytree to update when add new page."

Is this outdated or still working a bit?

3
2A01:E35:8A8D:FE80:9A7:81B4:B3AB:846F (talkcontribs)

Can we still use this extension?

FDMS4 (talkcontribs)

Why should it not work? There's a demo at Extension:CategoryTree#The <categorytree> tag

Christopher.ursich (talkcontribs)

I think you are asking whether CategoryTree is still under active development, versus being Abandonware. In using it for a few years, my experience has been that, although it does not change frequently, it is still maintained.

Reply to "Is this outdated or still working a bit?"

Expand category tree sidebar to show current page/category

2
208.72.125.2 (talkcontribs)

Is it possible to automatically expand the sidebar to show the current page the user has navigated to?

Thanks

Tacsipacsi (talkcontribs)

I think no and won't be. The categories are not in a tree so one can get to the main category from a given subcategory in several, sometimes hundreds of ways. Usually the farer a category from the main category is, the less members it has, so the sidebar could be several times longer than the content itself. Also, what about non-category pages? There may also be pages from which one can't get to the main category choosing strictly one of the parent categories, or don't have categories at all.

Reply to "Expand category tree sidebar to show current page/category"
143.112.144.129 (talkcontribs)

I'd like to make a category tree for a sub-category, but only if the elements are also in another category. Is this possible? Thanks in advance.

Tacsipacsi (talkcontribs)

No, there is currently no option for this.

Reply to "Conditional Trees?"
Christopher.ursich (talkcontribs)

My wiki requires users to log in before seeing any content. CategoryTree in the sidebar, however, does leak category names even to unauthenticated users. Is there a way to prevent that?

Reply to "Hide from sidebar until after login?"