0
votes

I am new to Drupal and I have been trying to figure out how to create a field in Drupal 7 views to group my content by a specific taxonomy term. I've already attempted to use the vocabulary this taxonomy term belongs to, but it will also group with other taxonomies under the same vocabulary, which I don't want to do. Essentially what I want to do is this:

Vocabulary

  • taxonomy term parent (show)
    • taxonomy term child
  • taxonomy term parent (ignore/hide)

Right now I can select the vocabulary for the field as content: [vocabulary], but what I want is content: [vocabulary > taxonomy term parent (show)]. How do I do this?

1

1 Answers

0
votes

This can be achieved with a relationship using the following steps:

  • Add a relationship to the view, select "Taxonomy term: Parent term" and call the relationship "Parent" (Identifier)
  • Add the field "Taxonomy term: Rendered Taxonomy term"
  • In the field settings under Relationship, select "Parent"
  • In the Format settings add "(Parent) Rendered Taxonomy term" as Grouping field Nr.1.

This will grouped the child terms under their parent terms. Make sure your view is of Taxonomy terms and not Content. You don't need to use the Rendered Taxonomy term field, as long as you select the Relationship in field settings you can control which fields are rendered.