By fisty on
Hi,
I've found this - http://drupal.org/node/38768
Is it possible to get terms from two volabularies with one query to DB? (eg vocabulaires with id 1 and id 2)
Hi,
I've found this - http://drupal.org/node/38768
Is it possible to get terms from two volabularies with one query to DB? (eg vocabulaires with id 1 and id 2)
Comments
A few approaches
If you just want a subset of the terms for a node for selected vocabularies you could do this
With Drupal 5 since you already have a node you can change this to
Shocked!
WOW! I'm really shocked (in positive way) with speed and how good this answer is. It's exacly what I want! :) Big thanks nevets!
Now I can share code with You.
It replaces
print $termswith
What I want to do is, on home page (and any other diffrent that node), show only "main" category witch is always one (single?) in my case, and when somebody enter a story show additionaly tags of this entry.
If there is a better way to do this I will hear it with pleasure.
(sorry form my english, unfortunatly I'm far away form native speaker ;] )
Your code makes an assuption about ordering
While the else case make work for you it would be probably better to 'else' code something like to avoid the assumption;
An alternative approach to the 'else' section would be to list terms by vocabulary name like this
Once again thank You.
Once again thank You. Your help is invaluable to me. If we meet somewhere You got beer from me. ;-)
I've simplified the whole code:
I don't know is it well coded, but in think it's the shortest and simpliest way.
Subscribing, greetings,
Subscribing, greetings, Martijn