Display Descendants
sashken2 - March 31, 2009 - 05:45
| Project: | Taxonomy Menu |
| Version: | 6.x-2.4-beta1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | fixed |
Jump to:
Description
Why "Display Descendants" make this url:
taxonomy/term/10 14 20 121 165 224 56 147 368 465 489 520 22
But not this:
taxonomy/term/10/all
I think this will be good, and url aliases must work with this url

#1
I did some testing using 'all' and received mixed results.
Using default taxonomy page callback. No views
Using the taxonomy view
PathAuto does not apply the correct url alias.
I did a little playing with views but couldn't get the right configuration. If this is implemented (and I think it should be) then a detailed use case is needed as part of this issue: #419798: Use case documentation .
Here is how to implement if you want to test:
Change the function taxonomy_menu_path_default starting at line 533 in taxonomy.module
From:
<?php
function taxonomy_menu_path_default($vid, $tid) {
//if tid = 0 then we are creating the vocab menu item format will be taxonomy/term/$tid+$tid+$tid....
if ($tid == 0) {
//get all of the terms for the vocab
$vtids = _taxonomy_menu_get_terms($vid);
$end = implode(' ', $vtids);
$path = "taxonomy/term/$end";
}
else {
$path = taxonomy_term_path(taxonomy_get_term($tid));
if (variable_get('taxonomy_menu_display_descendants_'. $vid, FALSE)) {
//we wait to run this instead of durning the if above
//because we only wan to run it once.
$terms = taxonomy_get_tree($vid, $tid);
foreach ($terms as $term) {
$tids[] = $term->tid;
}
if ($tids) {
$end = implode(' ', $tids);
$path .= ' '. $end;
}
}
}
return $path;
}
?>
TO
<?php
function taxonomy_menu_path_default($vid, $tid) {
//if tid = 0 then we are creating the vocab menu item format will be taxonomy/term/$tid+$tid+$tid....
if ($tid == 0) {
//get all of the terms for the vocab
$vtids = _taxonomy_menu_get_terms($vid);
$end = implode(' ', $vtids);
$path = "taxonomy/term/$end";
}
else {
$path = taxonomy_term_path(taxonomy_get_term($tid));
if (variable_get('taxonomy_menu_display_descendants_'. $vid, FALSE)) {
$path .= '/all';
}
}
return $path;
}
?>
#2
May be it help.
In version 6.x-1.02 - "Display Descendants" works good.
#3
Thanks for the suggestion sashkenn but the versions interface the the menu date completely differently. The past version controlled how the screen was displayed but this version doesn't. While this gives you ultimate control for the experienced Drupaler, the beginner is fewer options (taxonomy module or a view).
This issue is out there for a default page callback to be created. I just haven't gotten to it yet. #407490: Default Page Callback for Taxonomy Menu
#4
Added to 2.4-beta1. Please test.
#5
Looks good to me
#6
Set to fixed since this is part of the latest version.