0

Based on this question, I've obtained an "Indexed Node: Taxonomy Name" field in my view.

How can I group the results by parent terms? When I group by the term field (Format > Settings > Grouping field Nr.1), no parent terms are displayed.

1 Answer 1

2

You can also add the parent term to the index.

So if you have field_category as your term field you will be able to index field_product_category:parent.

Note that you may have to use the "Add related fields" section at the bottom of the fields admin page for your index to add the parent term relation before you can add the parent term tid or term name etc.

Then in your view also add the parent term name field and exclude it from display and then group by it.

2
  • Thanks, this was helpful. A couple issues though. 1) This only works if workflow/"Index hierarchy" for the field is NOT on, which is kind of a show-stopper since I need the facets ordered correctly (An issue here on the topic). 2) Multiple levels of parents are all thrown into the same field as "All parent terms (indexed)", and I don't know if you can separate them for grouping by each. Commented Apr 2, 2015 at 17:56
  • I'll accept the answer though because it does answer the question. Also, after some thought, the UX of facets is probably better served by simply providing an intuitive facet order/display rather than trying to add in advanced grouping to the view result display. Commented Apr 2, 2015 at 18:55

Your Answer

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

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