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.
We've implemented a sorter for a project that sorts term-based facet-results by their term-weight. Thought it might be of general use.
Comment | File | Size | Author |
---|---|---|---|
#19 | sort_facets_by_weight-2833340-19.patch | 685 bytes | surbz |
#17 | sort_facets_by_weight-2833340-16.patch | 671 bytes | surbz |
#4 | sort_facets_by_weight-2833340-4.patch | 8.23 KB | danquah |
Comments
Comment #2
danquah CreditAttribution: danquah at Reload commentedComment #3
borisson_This is looking great! I actually had a question about this functionality very recently. Thanks!
I don't think I'll commit this without any tests though.
I think
implements SortProcessorInterface
is superfluous as theSortProcessorPluginBase
already implements the same interface.Comment #4
danquah CreditAttribution: danquah at Reload commentedMakes sense :) I've removed the "implements SortProcessorInterface" and test-cases for a couple of term-weights. Is the test thorough enought?
Comment #7
borisson_Test looks fine, committed! Thanks and sorry for letting this sit for so long.
Comment #8
nicola85 CreditAttribution: nicola85 commentedWhy this was removed here http://cgit.drupalcode.org/facets/commit/?id=632f9547f353f7b3a6c1cc0bd16... ?
Comment #9
borisson_@nicola85: Looks like I made a mistake while committing that patch, I'll try to see if the patch in #4 still applies.
Comment #11
borisson_Committed this again.
Comment #13
bmcclure CreditAttribution: bmcclure as a volunteer and at Top Floor commentedThis functionality isn't working for me. Is it incompatible with using the hierarchy?
I'd like to display facets hierarchically, following the same sorting as the terms themselves, but the term weight sorting option doesn't seem to have any effect in my case.
Comment #14
borisson_@bmcclure: #2864336: Facet sorting for hierarchical vocabularies, so yeah, that currently doesn't work yet.
Comment #15
surbz CreditAttribution: surbz commentedAdding the sort order key in the yml file.
Comment #16
borisson_@surbz could you open a new issue for that? That way we can track and give proper attribution. Thanks!
Comment #17
surbz CreditAttribution: surbz commentedhttps://www.drupal.org/files/issues/sort_facets_by_weight-2833340-15.patch had a trailing white space , uploading the fixed one.
@borisson_ okay i will do that.
Thanks
Comment #18
surbz CreditAttribution: surbz commentedThis patch the sort order key in the yml file for 8.x-1.0-alpha6
Comment #19
surbz CreditAttribution: surbz commentedhttps://www.drupal.org/files/issues/sort_facets_by_weight-2833340-18.patch had a trailing white space , uploading the fixed one.