Extension talk:CategoryTree

Jump to: navigation, search

About this board

Archives 

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

New Instructions are Confusing and Unclear

1
Johnywhy (talkcontribs)

this instruction is incomplete and confusing:

"if [when??], then mode=pages will be used. It means that if the site configuration hasn't been changed [changed in what way?], the following are equivalent (site configuration may affect the third one)"

Extension:CategoryTree#Notes on the 'namespaces' parameter

Previously, the notes said "otherwise... otherwise... otherwise". Three "otherwise" in sequence is confusing. I attempted to improve with bullets. Meaning is still unclear.

Reply to "New Instructions are Confusing and Unclear"
Johnywhy (talkcontribs)

the tree still shows deleted pages.

Johnywhy (talkcontribs)

Tree shows old version of renamed page.

Any fix?

thx

Reply to "How to force refresh?"

force categorytree to update when add new page.

10
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)
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;

Johnywhy (talkcontribs)

thx for that, could be useful for other things!

but, doesn't seem to fix CategoryTree...

This post was hidden by FDMS4 (history)
Reply to "force categorytree to update when add new page."
Johnywhy (talkcontribs)
Ciencia Al Poder (talkcontribs)
Reply to "How does ifeq work?"

How to Restrict CategoryTree to a Particular Namespace?

9
Summary by Johnywhy

"Category" is a namespace. So, when you use the namespaces parameter, you must include Category in namespaces, if you want subcategories to show up in the result.

Example:

{{#categorytree:TOC|hideroot|namespaces=Main Category}}

If you don't include the namespaces parameter, then "namespaces=Category" is implied.

The "mode" parameter is disabled by the "namespaces" parameter, but you can achieve categories mode by leaving namespaces blank. Subcategories will appear, but not pages:

{{#categorytree:TOC|namespaces=}}

hideroot works as expected.

.

Notes added to the Extension documentation:

Extension:CategoryTree#Notes on the 'namespaces' parameter

and

Extension:CategoryTree#When i use the namespaces parameter, i don't get any pages

Johnywhy (talkcontribs)

Re gunretort.xyz

Doc says:

a list of namespaces from which pages should be shown in the tree (since rev:36864, July 2008). The entries in the list must be namespace names, separated by spaces. The main namespaces can be represented by "-" or "0". This overrides the mode option. 

But, none of these work-- i get an empty tree

{{#categorytree:TOC|hideroot|mode=pages|namespaces=Main}}
{{#categorytree:TOC|hideroot|mode=pages|namespaces=-}}
{{#categorytree:TOC|hideroot|mode=pages|namespaces=0}}
{{#categorytree:TOC|hideroot|namespaces=Main}}
{{#categorytree:TOC|hideroot|namespaces=-}}
{{#categorytree:TOC|hideroot|namespaces=0}}
Tacsipacsi (talkcontribs)

Of course you get an empty tree, as Category:TOC is empty. I works for me with an existing category.

Johnywhy (talkcontribs)

TOC isn't empty

Tacsipacsi (talkcontribs)

Just click on the red link above. It’s completely empty. (If you use another wiki, where it’s not, you should mention it. This extension works perfectly on this wiki.)

Johnywhy (talkcontribs)

For gunretort.xyz

Note, TOC tree works fine on my site, gunretort.xyz: returns all categories and pages. This works, no prob:

{{#categorytree:TOC|hideroot|mode=pages}}

The problem is `namespaces=Main` doesn't work. None of these work:.

{{#categorytree:TOC|hideroot|mode=pages|namespaces=Main}}

{{#categorytree:TOC|hideroot|mode=pages|namespaces=-}}

{{#categorytree:TOC|hideroot|mode=pages|namespaces=0}}

{{#categorytree:TOC|hideroot|namespaces=Main}}

{{#categorytree:TOC|hideroot|namespaces=-}}

{{#categorytree:TOC|hideroot|namespaces=0}}

@Duesentrieb

Tacsipacsi (talkcontribs)

The first one (namespaces=Main) works for me using the API (I haven’t tested the other ones). I used the API because I can’t test using the normal edit interface, as anonymous users cannot edit pages. (Please note that some security software may warn for possible XSS (cross-site scripting) attack for the above URL. It’s because of the curly brackets in the wikicode, and the page is absolutely safe to visit.)

Johnywhy (talkcontribs)

Thx for testing. I see your url is:

https://gunretort.xyz/api.php?action=parse&text={{#categorytree:TOC|hideroot|mode=pages|namespaces=Main}}

It brings up a page of raw json. I notice that it only contains the word "Welcome". It doesn't show any of my subcategories or pages.

I tried your syntax on a wikipage

{{#categorytree:TOC|hideroot|mode=pages|namespaces=Main}}

Again, the result is just the word "Welcome", which is the only page in the top-level TOC category. It does not have an assigned namespace: https://gunretort.xyz/index.php/Welcome

Other pages are in sub-categories of TOC, with no assigned namespace. They don't appear in the tree. Shouldn't they?

This syntax shows all sub-categories, all pages:

{{#categorytree:TOC|hideroot|mode=pages}}

Clue: Extension doc says "namespaces" parameter: >"This overrides the mode option." It's unclear what "override" means. But it seems it actually disables subcategories.

I performed another test: i created a page in the TOC category, and the "Published" namespace. I also moved a different page to Published namespace, in a subcategory. We get only the page in the top-level TOC category, Published namespace. More evidence that 'namespaces' parameter ignores subcategories.

{{#categorytree:TOC|namespaces=Published}}
Tacsipacsi (talkcontribs)
Johnywhy (talkcontribs)
Johnywhy (talkcontribs)

Doc says

> "to drop your own wikitext article into the Sidebar, and then add CategoryTree items to it...."

  • What does that mean? What "article"? i thought we're talking about a tree. Do they mean a link to an article?
  • What does "add items" mean? I thought the point of the tree is that all items are automatically added.

> If you want the CategoryTree on a different position in the sidebar, you can reference it on MediaWiki::Sidebar as "categorytree-portlet"

  • tried that. It just gave me a link to a non-existent page called "Categories".

> To append a link "CategoryTree" to your toolbox (sidebar) add following code to the javascript-page...

  • Huh? All that javascript just for a link to category tree? But i want the whole tree.

> Add these lines to LocalSettings.php:

  1. > $wgCategoryTreeSidebarRoot = 'Category:article_name';
  2. > $wgCategoryTreeForceHeaders = true;
  • Again-- unclear. What's the point of a tree, if we're only putting one article in the sidebar?
  • Where are the parameters in above instructions? If i've worked out a set of parameters that gives me the exact tree i want, how do i apply those parameters to a tree in the sidebar?
Reply to "Problems Adding Tree to Sidebar"

Is there a "folder icon" alternative format for CategoryTree

1
GregRundlett (talkcontribs)

I'd like to use "folder" icons for categories, and mime-type "page" icons to mimic a file browser instead of the small triangles of CategoryTree. Does such an option exist, or does anyone know of an implementation that does so? Something like this jQuery plugin

Reply to "Is there a "folder icon" alternative format for CategoryTree"

Hook to run function and allow changing value of $wgCategoryTreeSidebarRoot

1
Ksumwalt (talkcontribs)

I want to have two values for $wgCategoryTreeSidebarRoot, one for when a user is logged in and a second for anonymous users. This would allow for a limited list in the sidebar for anonymous users when using the categorytree-portlet. I should be able to create a function in localsettings.php and link it with a hook function but can't figure out what hook to use and get the value changed. Any suggestions?

Reply to "Hook to run function and allow changing value of $wgCategoryTreeSidebarRoot"

Showing "Pages" in sidebar not working

3
99.73.116.125 (talkcontribs)

The default functionality for the sidebar works fine, but when put into pages mode it no longer works (no drop down arrows show).

$wgCategoryTreeSidebarRoot="Categories";

$wgCategoryTreeSidebarOptions['mode']='pages';

Mediawiki version 1.27.4.

104.129.194.54 (talkcontribs)

I am experiencing this as well and considered the fix shown by bhuber below Topic:Sde4gvisgd1ffcez under "Fix for making CategoryTree work in sidebar again with MW 1.24.1 and Vector skin" but it appears the .js file has been changed since then as the beginning area was different.

Ksumwalt (talkcontribs)

To fix this, apply the same basic principle as explained in Topic:Sde4gvisgd1ffcez by looking for

$content.find( '.CategoryTreeToggle' )

and changing it to

$( '.CategoryTreeToggle' )

which is removing the content.find. be sure to leave the leading $ character.

This edit is still made in the file:

ext.categoryTree.js

which is in the modules subfolder of the extension

Reply to "Showing "Pages" in sidebar not working"

Downloading all articles in a category and its sub-categories

2
طاها (talkcontribs)

I need to download the title of all articles which belong to a category or one of its sub-categories (at any depth). How can I do it with this tool? Do you have a better suggestion for doing what I want to do?

Ciencia Al Poder (talkcontribs)
Reply to "Downloading all articles in a category and its sub-categories"