I'm trying to get contextual filters to work with natural sort on my site as well. It used to work years ago, as reported by SurajHo in #7, but the "Node: Title - Natural" field is now gone.
Can you give me any pointers to get this feature working again? I have read the comments here and at the issue linked at #5 but have no idea how to proceed.
- πΊπΈUnited States keiserjb
From what I can tell, Node: Title - Natural field existed in the 7.x-1.x version of the module. Not sure how to get that capability back.
I tried comparing the code for that version with the current one. There are major changes throughout and I couldn't figure out what was the relevant part for the Node: Title - Natural field.
I was able to work around this problem by defining a Computed Field to hold the "natural sort" version of the title. Obviously, this isn't a great solution since it involves calculating and storing the same info a second time. But it does work with contextual filters.
- Merge request !10Issue #2832868: Make natural sort value available as a contextual filter β (Open) created by generalredneck
- last update
over 1 year ago 1 fail - Status changed to Needs review
over 1 year ago 2:01pm 17 July 2023 - πΊπΈUnited States generalredneck Texas, USA πΊπΈ
Ok yall,
I made some headway on this. Keep in mind that my solution requires the fix in π Natural sort does not work with text fields anymore Needs work .
You can see the difference between the 2 branches in the following diff.
I have committed a test view in there. I've enabled "Glossary mode" on my contextual filter and as you can see it uses the first character of the raw transformed data. Keep in mind that this doens't work well for "numbers" so that's something yall will want to contend with. You can see that "A" works well and exactly like yall expected.
I've added full access to all the VNS information using Views. You can list all the records in that table if you want, but really needed to do that in order to allow relationships to work which allows contextual filters. Give it some tests, let me know how it works for yall.
- πΊπΈUnited States plato1123
Just curious if this has been implemented in any current release? I also am struggling with how to make this work as a contextual filter. Thanks!!
- πΊπΈUnited States generalredneck Texas, USA πΊπΈ
Nope still hanging out here waiting for feedback. I'm taking a guess noone has tested my work. I'll come back to this at some point this quarter.
- πΊπΈUnited States plato1123
Ok, let me dig through your comments & code a little deeper and maybe I can provide some feedback. Thanks!
- πΊπΈUnited States plato1123
Apologies, is there a place I can pull the full code I need to test this or do I need to pull and then apply successive patches? Thanks!
- πΊπΈUnited States generalredneck Texas, USA πΊπΈ
Everything is part of the merge request. You can get the patch or the full code from the links up above. If toy are using beta8 it appears the patch may not apply cleanly at the moment
- πΊπΈUnited States generalredneck Texas, USA πΊπΈ
@plato1123
I got this rerolled for you. See if you can give it a look now. Either check out/download the MR or pull in the latest dev release and apply the patch from the "plain diff" link above.