Jump to content

Repeater field usability; reverse order/collapsed items


a-ok
 Share

Recommended Posts

Hi folks,

I have a repeater field set up and there's a few issues with the usability that I was curious to know if there were any options to improve this? 

  1. Is it possible to make a repeater element add to the top, rather than the bottom? I know you can drag/drop but if it's a long repeater then it can get clumsy.
  2. If the possible isn't an option, is it possible to have the repeater rows collapsed by default?

Any thoughts?

Link to comment
Share on other sites

As far as I know you would need to add some custom css/js to accomplish this.

This could help modules.processwire.com/modules/admin-custom-files/ but there other approaches out there, e.g. custom module or /site/init.php or /site/ready.php

Sorry don't have a quick example write know

Or you could even take /wire/modules/Fieldtype/FieldtypeRepeater folder copy it to /site/modules/ make you changes/additions go to your admin backend click on modules -> refresh and then choose your Fieldtype repeater version (Processwire will detect both versions after refreshing and prompting you to choose in a notification)

cheers Can

  • Like 1
Link to comment
Share on other sites

Thanks for the reply, @BernhardB. PageTables sound like a good option but just seemed like a bit too much for what I wanted to do.

@Can, yes so I could add a collapsed class to the rows already? That may work... just wasn't sure if there was an update to the Repeater module on the cards that would solve this. It would make a good upgrade, no?

Link to comment
Share on other sites

That may work... just wasn't sure if there was an update to the Repeater module on the cards that would solve this. It would make a good upgrade, no?

I do believe this is on the todo list for repeaters, along with the ability to name each one (which is pretty important if they are initially collapsed).

  • Like 1
Link to comment
Share on other sites

I do believe this is on the todo list for repeaters, along with the ability to name each one (which is pretty important if they are initially collapsed).

Do you know where I can see the dev list for PW? I know 2.7 just came out and wasn't on that so hoping for 3?

Link to comment
Share on other sites

Do you know where I can see the dev list for PW? I know 2.7 just came out and wasn't on that so hoping for 3?

There is really only the roadmap: https://processwire.com/about/roadmap/

I have asked Ryan for this functionality outside of the forum and his response was positive, but you won't see it mentioned anywhere official.

Link to comment
Share on other sites

I wonder that the simple css3 trick could help here: flipping the whole repeater container and also the individual repeater items (using transform: scaleY(-1)). So the list would effectively get reversed. Will try it later on PC.

Update:

just tried and it works fine. New items added to the top, even before save (visually only, of course).

Link to comment
Share on other sites

@tpr and @LostKobrakai I guess the only problem would be that the 'Add row' button would be at the bottom, still?

@Cerulean Thanks for this. This sounds good but I'm wondering whether you can change the order (new items added to top, not bottom) and whether you can set them to be collapsed by default? I couldn't find it in the documentation but maybe I just need to try it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...