Forum Academy Marketplace Showcase Pricing Features

Repeating Group Ordering

I’m creating an FAQ with multiple repeating groups stacked on top of each other. Each repeating group holds the Q & A’s of that section. For sorting purposes, I could assign each question a number, but poses a problem in the event I want to revisit this page and want to insert a question midway through a section? It would be inefficient to renumber each question. Are there any suggestions as to how to solve this problem?

I ask because I previously ran into this issue in a different context. There must be another way to think about this…

Give each section an integer value and add a voting function only visible to you (on a different page perhaps). Vote up the sections to push things up, vote down to push down.

1 Like

Wouldn’t this mean that to add something mid way through the page @csblack would have to upvote the new entry many times and then down vote another entry many times?

Another way to do this is to put the FAQs into one thing as one field i.e. the whole FAQs is entered as a single textblock. This way when you edit the text, it would update.

Perhaps. You could make one arrow worth 10 points and another worth 1. Not experienced enough with any other way. There may be a way to add an item midway through a list, but I don’t know it. I know the “plus” command appends it to the end, but I’ve read the reference and I don’t think there’s one for inserting at item #.

1 Like

I think you will still get into the issue that you will have to renumber the list.

The logical way would be to have “prev” and “next” pointers embedded.

But … how to display that in a repeating group.

I’ve been breaking my head about how the user could sort individuals entries in a RG (while drag and drop is not available), your solution is amazing!

2 Likes

So, another way to do this is to think about the action being simply swapping two items around.

Click on one… then click on where you want to send it …

The list has a position data field.

You have a couple of custom states, one that holds the first clicked (if the state is empty) and a condition shows it is selected.

The second state holds the position of the second clicked entry (if the first state is not empty).

On the second entry you swap the two position fields over (using the position state as a temporary variable) and clear the states.

Not sure it is obvious (maybe it should recess and show a “select destination”. But it works I think.

Will see if I can make it look nicer and stick it into buildingonbubble some time.

6 Likes

Exactly how I did it Nigel.

1 Like

This blew my mind. Didn’t realize that altering the state of a page could offer so much.

2 Likes

Wow. Thank you. Invaluable. Glad I asked.

1 Like