Closed (works as designed)
Project:
Taxonomy Term Reference Tree Widget
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
27 Mar 2012 at 11:12 UTC
Updated:
28 Mar 2012 at 15:42 UTC
Comments
Comment #1
bartk commentedThe tree widget is intended to display the contents of a field, not the entire contents of a taxonomy tree. What you're asking for is outside the scope of this module, and would need to be done with a custom coded block.
Comment #2
cis_dream commentedI'm asking about is that possible to generate the tree according to vocabulary id. There is any function available to achieve this task.
Just want to generate tree like structure of any vocabulary and display them as a block on any page of the site.
is this possibel??
Comment #3
bartk commentedYes, this is very doable in PHP, but you'll need to create your own module to do it.
The function _term_reference_tree_get_term_hierarchy in my module loads the tree structure, although it does a bunch of extra stuff that you probably wouldn't care about. You can also use the taxonomy_get_tree function in the API, which I personally don't like because it returns a flat array with a depth and is a bit harder to work with, but should still work for usable for what you're trying to do.
Regardless, in your block rendering function, you could just iterate through the tree (or the list) and print out the HTML for the taxonomy terms.