Hi, i'm just learning about drupal developing and stuf, my issue might be a peace of cake for you, this is what i need: display a list of taxonomy terms given a vocabulary id, like this:
tid -> termname
1 -> term1
2 -> term2
etc
this is what i have:
$terms_for_vocabulary1 = taxonomy_get_tree(1, $parent = 0, $depth = -1, $max_depth = 1);
foreach ($terms_for_vocabulary1 as $value) {
print $terms_for_vocabulary1 [$value][tid] .' -> '. $terms_for_vocabulary1 [$value][name] . '<br />';
}
and this is what i get:
->
->
->
->
->
besides ten of this warnings:
warning: Illegal offset type in ...\www\root\includes\common.inc(1347) : eval()'d code on line 5.
What am i doing wrong?
Thanks in advance
Comments
Comment #1
leanazulyoro commentedups, sorry, this is the code i have:
just changed this: $terms_for_category[$value][tid] for this: $terms_for_category[$value]->tid
Comment #2
Miszel commentedTry out this:
Comment #3
leanazulyoro commentedthanks Marcin, thats perfect
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.