2

How can I display all field values that are on the taxonomy terms that are applied to a given node?

So say I have the following Vocab defined:

Vocab name:Fruit Description:Fruit Categories w/ codes Field: fruit_code

And I add the following terms:

tname:Apple fruit_code:appl tname:Orange fruit_code:orng tname:Pine Apple fruit_code:pin_appl

Now.. I can apply a field to my view that will output all the tax termnames associated with the nodes that are returned: ie. "Apple, Orange, Pine Apple"..

But when I add the relationship for tid to the view and then try outputting the fruit_code field.. I get duplicate nodes returned, one for each term applied to the node. How can I get the fruit_code to oupt in the same manner as the termnames in my view w/o having duplicate nodes displayed??

2
  • I deleted my answer, I totally misread the question. Apr 13, 2011 at 14:11
  • I don't really understand the question. What is the difference between the term name and fruit_code? Isn't fruit_code just the taxonomy reference field attached to the content type? Adding the field outputs the terms correctly. Why would you need a relationship? Apr 23, 2011 at 23:13

1 Answer 1

1

You can use the views distinct mode.

Drupal 7: Query Settings > distinct Drupal 6: Distinct

Either that or hook into the view and do some extra processing through a custom module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.