Jump to content

Recommended Posts

Posted

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?

Posted

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
Posted

On mobile but I know there is a topic about this on the forum. Did you try Google forum search?

In my opinion pagetable have a lot better ux most of the time. Maybe try that?

Posted

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?

Posted
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
Posted

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?

Posted

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.

Posted

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

Posted

Indeed, just tried. It has the benefit that it needs to be added only to the parent element.

Posted

@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.

Posted

In the same manner you could tweak css to add the Add item button to the top.

post-3156-0-50542000-1448874450_thumb.gi

I'm not sure if this is the best way to achieve this but it works, and perhaps with the fewest side effects.

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
×
×
  • Create New...