I have nodes which are tagged with one or more taxonomy terms.

I am using Views to display these nodes grouped by their taxonomy term.

It always works fine. However, if a node has two taxonomy terms it is displayed twice in a group.

For example:

Group 1: Colours
Red
Yellow
Green
Orange
Red 
Yellow
Green
Orange

Group 2: Fruits
Apple
Pear
Mango
Orange
Apple
Pear
Mango
Orange

How can I display it so it is like this:

Group 1: Colours
Red
Yellow
Green
Orange



Group 2: Fruits
Apple
Pear
Mango
Orange

I.e. so each node is distinct per a group but can still appear in multiple groups.

Comments

ravi.kumar88’s picture

This can be achieved by the aggregation property of the views.You need to enable it from the advanced setting as Use Aggregation:Yes
Complete steps are as follows:
1. Create view with any format.Under the setting select the desired tag in the grouping field.(Note: You need to add your tag field in the fields,and if you dont want it you can Exclude it from displaying).
2. After that apply filter to select both tags ie color and fruit.
3. You will see all the contents (including duplicates)
4. Now Enable the Aggregation under the advanced tab.
You will get the desired result.

ravi.kumar88’s picture

Issue summary: View changes

Fixed formatting

MustangGB’s picture

Issue summary: View changes
Status: Active » Closed (outdated)