Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I can see that "Content:Has taxonomy term (with Depth)" is available as a contextual filter.
But I would like to use the Group by function to display my Taxonomy Terms in their hierarchical form, if nothing else than to provide a menu to use to select the term for the contextual filter view.
Am I just not finding the built-in functionality to do that, or is this a feature request?
Comment | File | Size | Author |
---|---|---|---|
#7 | view-listing.png | 120.77 KB | cristiroma |
#7 | group-parent-terms.png | 86.89 KB | cristiroma |
#7 | view-field-plugin-formatter.png | 95.19 KB | cristiroma |
#7 | view-fields.png | 64.04 KB | cristiroma |
Comments
Comment #2
DamienMcKennaViews was moved into core in D8, so I'm moving the issue over to its issue queue.
Comment #3
bunthorne CreditAttribution: bunthorne as a volunteer commentedI have figured out how to Group by a taxonomy depth by creating a Relationship for a Taxonomy term to its Parent, then adding a field for the Term that uses the parent Relationship. I can repeat this for a second level of relationship. I then have to Filter out terms that are empty so the higher levels don't repeat themselves in the view, but the whole process seems awkward. It would be much nicer to have a Taxonomy Depth value available as a field for Group by.
Comment #7
cristiroma CreditAttribution: cristiroma commentedIn our case we wanted to group the terms by their root ancestors, so we did in the following manner: Add to the view fields the parent field and, configure for it a field formatter plugin that always returns the root ancestor label, then group the results by the parent label.
Will result:
Steps to implement1. Create a field formatter view plugin that always returns the root parent label
2. Add name and parent field to the list of fields
3. Set the plugin as field formatter for the parents field
4. Configure grouping by the parent field (which returns always to root label)
5. Save the view and check the listing