Group terms with common parents

Created on 13 March 2019, almost 6 years ago
Updated 2 February 2024, 11 months ago

If I have a taxonomy hierarchy, I would like to be able to display terms with their parents, but not repeat the parent terms when displaying multiple children in sequence.

For example, given the taxonomy:

- Parent A
-- Child I
-- Child II
-- Child III
- Parent B
-- Child IV
-- Child IV
-- Child VI
- Parent C
-- Child VII
-- Child VIII
-- Child IX

and a node containing a field with the values "Child II", "Child III", and "Child IX", I would like to display:

- Parent A
-- Child II
-- Child III
- Parent C
-- Child IX
✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jlicht

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡¦Ukraine dinazaur

    Attached the patch based on #9 with fixed fatal errors on D10.

  • First commit to issue fork.
  • Merge request !13Issue #3039982 - Add common parent β†’ (Merged) created by AstonVictor
  • Status changed to Needs review 11 months ago
  • πŸ‡ΊπŸ‡¦Ukraine AstonVictor

    Created a new MR.

    Added a new option to select grouping terms.
    Currently, it only works for the first level.

  • Status changed to Fixed 10 months ago
  • πŸ‡ΊπŸ‡¦Ukraine AstonVictor

    Merged the MR.

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • πŸ‡³πŸ‡±Netherlands Summit

    Hi, Term Hierarchy for terms before and after patch are different used in views, please make them the same.

    Older terms saved before for the patch use the Hierarchical Term Formatter normal view separator and the Settings for multiple fields as such that the normal views separator needs to be empty otherwise the following occurs:

    normal view separator ">"  
    multiple fields separator "-"
    Parent : USA
    Child: New York
    Child: New York City
    Child: Manhattan
    Child 
    
    As such USA -> New York ->> New York City ->>> Manhattan
    

    So some how the normal view separator is shown more because of the parent-term relation and place in this relation?

    Newer terms saved after this patch do not have this behavior somehow.

    So I can't use the normal view separator anymore, because I have thousands nodes with parent-child relations which are showing not the correct .
    Correct should be USA -> New York -> New York City -> Manhattan

    greetings, Martijn

Production build 0.71.5 2024