I’m trying to make a listing of users, separated by letter of the alphabet, with a big letter and an anchor tag… typical online directory stuff… Not seeing a quick way to do this…
This was fun to figure out…
Have a group for every letter. Inside each group, have a repeating group. Set the source: Search for Users. Add a constraint for the name to be greater than the previous letter and less than the next letter. For greater than previous letter, you’ll need to do PreviousLetterZ…
For A Group
Name < B
For B Group
Name > AZ
Name < C
… and so on…
For Z Group
Name > Y
I put them in groups so that you can collapse if there are no names with that group’s letter. See screenshots and let me know if you have any questions.
Hide & Collapse if Empty
Result with D containing 0 users
Gaby | Coaching Bubble
Took a bit of fooling around, but I was able to get it with what you posted Gaby, thanks!
Wow - this is great!
Thanks for posting.
Very nice solution, @romanmg !
I didn’t know that i can check letters against others with “>” and “<”…
Your solution helped me to build an even more elegant solution, in case you want to have the single groups stacked within a Repeating Group:
- I have 2 nested RG, the parent for the letters A-Z, the child for the names.
- I have an “ListOfNumbers” element i took from the new -and very useful- toolbox plugin (Toolbox plugin - collection of utility elements), which i’m using to build the parent RG with 26 generic entries for the letters.
- In the child RG i test all names against the alphabet letters one by one with the help of the regex expression like so:
- Empty letters can be hidden with a condition on a -collapsible- group with the child RG stacked into it:
It works quite well, you can check it here:
And here comes the corresponding bubble dev page:
Hope somebody find it useful.
Nice! The result looks great. I have used Bubble’s truncate text command to achieve something similar. So you would simply match each letter of the alphabet (your main repeating group entries) to a truncation of the user’s name, i.e to the first letter of the name.
Thats how it basically works, yes! Though your version sounds much more simple somehow