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.

Comments

Status:Active» Closed (duplicate)

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

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.

Avorathol,

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

Thank you,

Hello,

I have a really simple patch :
Modify line 353 :

<?php
$tree
= menu_tree_all_data($mid);
?>

by
<?php
$tree
= menu_tree_all_data($mid, null, variable_get('site_map_categories_depth', -1));
?>

NiR:

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.

StatusFileSize
new670 bytes

@NiR
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

<?php
$tree
= taxonomy_get_tree($vid);
?>

to
<?php
$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.

Assigned:Unassigned» nitingoyal

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

<?php
$tree
= taxonomy_get_tree($vid, 0, variable_get('site_map_categories_depth', NULL));
?>

StatusFileSize
new647 bytes

Modified

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.

Status:Needs work» Needs review
StatusFileSize
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;
as
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.

StatusFileSize
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? :)

Thanks

Hello,

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.

Thanks!

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.