By PG-1 on
I want make hierarchical site, where parent terms show all nodes of their child terms. I could not find automatical methods to realize this, so I make menu with next structure:
- "News" - path: taxonomy/term/1+2+3 - alias: /news
- "Site news" - path: taxonomy/term/2 - alias: /news/site
- "Music news" - path: taxonomy/term/3 - alias: /news/music
If we use path aliases with constructions like "term/1+2+3", such menu items are working fine.
I use right method, or any better exists?
Comments
I found answer.Syntax of
I found answer.
Syntax of /taxonomy/term uses list of nodes as first parameter and list depth as second parameter. Also, second parameter can be "all".
So, I must use next menu scheme:
- "News" - path: taxonomy/term/1/all - alias: /news
- "Site news" - path: taxonomy/term/2/all - alias: /news/site
- "Music news" - path: taxonomy/term/3/all - alias: /news/music
But how set terms to use this depth by default?
Complete
Complete solution:
http://drupal.org/node/39692#comment-76725
Q: "The ONLY thing I need now is the breadcrumb linking to /taxonomy/term/all instead of it's default. Is there some simple elegant hack that would change the "default" behavior of taxonomy.module to do this? Like one place where 0 is really all?"
A: "In taxonomy.module, about 80% down in the function taxonomy_select_nodes() there is a line like this:
$tree = taxonomy_get_tree($term->vid, $tid, -1, $depth);
Change it to this:
$tree = taxonomy_get_tree($term->vid, $tid, -1, NULL);
It sets the depth to NULL which is the same as all."