Plugin

Developer
Supported

EE 1
EE 2
Switchee

Back to this add-on's main page
View Other Add-ons From Mark Croxton

     

You must be logged in to post.

alphabetical index

Support Request

aro
aro

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
# 1
Developer
Mark Croxton

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
# 2
aro

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 ;-)