Developer
Supported
Switchee
Back to this add-on's main page
View Other Add-ons From Mark Croxton
alphabetical index
Support Request
|
aro
|
| Posted: 29 January 2012 01:26 PM |
|
|
|
|
Hi Mark,
don’t know if switchee is the correct way to do this (or ifelse or any other thing around), but let’s give it a try…
I have a Matrix field holding a list of names which must be sorted alphabetically. Every letter though must have a “heading”:
Letter A:
A1 (name starting with the letter “A”)
A2
A3
A4
...
Letter B:
B1
B2
B3
...
Since Lows Alphabet only handles entries I thought I can do this by switchee and some regex?!
Any thoughts?
Regards,
Achim
|
|
|
|
|
Mark Croxton
|
| Posted: 31 January 2012 12:21 PM |
# 1
|
|
|
Developer
|
You can use Stash and do something like this:
https://gist.github.com/1010797
But you’d need to do it for every letter, which seems a faff.
The problem is an interesting one, I think I may add some kind of grouped sorting functionality to the stash:get_list tag.
|
|
|
|
|
aro
|
| Posted: 31 January 2012 12:28 PM |
# 2
|
|
|
|
Hi Mark,
I solved it with php code in the template (which is not critical at this place) but would love to see it solved with stash ;-)
|
|
|
|