Include hierarchy when sorting by term weight

Created on 17 April 2018, over 6 years ago
Updated 23 July 2024, about 2 months ago

I wanted to sort taxonomy terms used in a facet by hand in a project, so I decided to use sorting by term weight for the purpose.

But the vocabulary in question has two levels, where only second level (L2) terms was used for facets, like this:

L1: T1
--> L2: T4
--> L2: T5
L1: T2
--> L2: T6
--> L2: T7

and so on. Now Drupal is writing the weights so that L2 terms begin always from 0. That leads to the fact that terms are sorted like T4, T6, T5, T7, which made no sense for the case.

What if I wanted terms sorted by their parent first, only then by their own weight? Or by hand regardless of their parent?

I guess the latter question is more difficult, but if it was enough to just take the parent weight into account, it would be fairly easy.

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇫🇮Finland jhuhta

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

Comments & Activities

Not all content is available!

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

Production build 0.71.5 2024