Hi all,
I've a two level vocabulary say

- A
-- B
-- C
-- D
- E
-- F

etc ... How do I get all first level terms from this vocabulary (A and E in my example) ?

I need an associative array (tid => "term name") to use it in a multichoice form.

My goal is to add a blog list type field to flexinode, so to display a list of all blogs associated with a
vocabulary.

thanks

p

Comments

adam.skinner’s picture

All top level terms have parent = 0 in term_hierarchy.

eveltman’s picture

taxonomy_get_tree() will help do the job as well and probably is a more "forward-compatible" choice than querying by yourself. You can use the max_depth parameter to only get the first level.