Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
By newindrupal on
How to list all nodes with children taxonomy terms from certain parent? Enabled default taxonomy view with depth modifier, but it doesn't seem to work..
Comments
take a look at these functions
and play with them in a block or page
Thanks! But can you be more
Thanks! But can you be more specific on how/where to use them?
something like ..
where the third param of http://api.drupal.org/api/drupal/modules--taxonomy--taxonomy.module/func... is depth
.. this code never hit a compiler ;)
edit: put that in a new block - with php as text format
Parse error: syntax error,
Parse error: syntax error, unexpected ',' in /modules/php/php.module(75) : eval()'d code on line 11
there was a closing braket too
there was a closing braket too much ..
@ytsurk, thank you for the
@ytsurk, thank you for the code!
I wonder now how can I get the $vid and $parent arguments for taxonomy_get_tree from the current node?
My content type has a single selection hierarchical vocabulary associated with it. So I want a block which lists all children of the term associated with the currently displayed node.
so - you have a fixed $vid
should do it ..,
to have it dynamically there are several ways,
for D7 look @ DBTNG
@ytsurk, you probably
@ytsurk, you probably misunderstood my question.
Let say I'm displaying a node, i.e. blog post, it has a single tag. I want to create a block which will display all children of the term associated with the current post. So the question is - how can I get this term id from the current node?
taxonomy_select_nodes
never did that, but you probably need to call this method
taxonomy_select_nodes
you'll find the termId in your nodeObject ..