I can't limit category depth, this variable (site_map_categories_depth) seems to be totally unused, neither to decide what is displayed on the site map, nor to build the taxonomy links (like http://drupal.org/node/483402 could make me fear).

This option could be very useful in a deep taxonomy.


darrell_ulm’s picture

Status:Active» Closed (duplicate)

This looks like a duplicate to this other issue which has a patch.
See: http://drupal.org/node/1593570

Avorathol’s picture

Status:Closed (duplicate)» Active

You can see that this other issue was mine too, and it's absolutely not the same bug.

The other one is on the false displayed main category count (and I'll repost a fixed patch soon). It's just the number in parenthesis which is false.

This one is on selecting until how many hierarchical levels (or depth) will be displayed in Site Map. 1: Just the first level, 2: its children too, 3: its grand children too,.... 0: all of them ?
In short, this variable (site_map_categories_depth) should do that, but isn't used anywhere in the code.

darrell_ulm’s picture


OK, I see what you mean, and if you have a patch, then that is certainly accepted in Drupal!

Thank you,

NiR’s picture


I have a really simple patch :
Modify line 353 :

$tree = menu_tree_all_data($mid);

$tree = menu_tree_all_data($mid, null, variable_get('site_map_categories_depth', -1));
darrell_ulm’s picture


Hey, that looks like it just may work., assuming you are meaning the .module file, where else could that line be, well anywhere really, but makes sense if it is in the .module or an .include.

I'll check it out.

nitingoyal’s picture

new670 bytes

The variable site_map_categories_depth is meant for Taxonomy depth but the changes that you recommended are meant for menu depth but that helped me to address this issue. I changed line 516 in .module from

$tree = taxonomy_get_tree($vid);

$tree = taxonomy_get_tree($vid,0,variable_get('site_map_categories_depth', NULL));

I tested it and it worked.Please test it and provide reviews.
frjo’s picture

Assigned:Unassigned» nitingoyal

This looks like a good patch but two spaces is missing:

$tree = taxonomy_get_tree($vid, 0, variable_get('site_map_categories_depth', NULL));
nitingoyal’s picture

new647 bytes


frjo’s picture

Status:Active» Needs work

Tested this now and the configuration option for depth need to be updated as well. The description is outdated and the default value should change from "all" to NULL.

nitingoyal’s picture

Status:Needs work» Needs review
new1.71 KB

Hi frjo
I modified the default value and also changed the description to
Specify how many subcategories should be included on the categorie page. Leave empty to return all levels.
Note that I added
variable_get('site_map_categories_depth') ? variable_get('site_map_categories_depth') : NULL;
variable_get('site_map_categories_depth',NULL) was not working as expected and I think it was taking default value '' rather than NULL

Please test the patch and provide feedback.

darrell_ulm’s picture

new1.76 KB

Hi daffodil,

Re-rolled this to apply after your prior patch :) -- thanks for that patch also.

Anyone want to test this on the -current - dev release or do you trust me to apply it? :)


darrell_ulm’s picture


Any other takers on quick testing the patch? @daffodil , could you give it a quick test to make sure it's OK. I'll give you attribution on it of course :) before I apply.


john.oltman’s picture

Issue summary:View changes
Status:Needs review» Fixed

In the new 7.x-1.1 release

Status:Fixed» Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.