Jump to content

PW 3.0.188 – More new repeater features


ryan
 Share

Recommended Posts

Like last week, this week, updates continued on the core and matrix repeater fields. Repeater and matrix fields can now be configured to use fewer pages. When set, it won't create placeholder pages for repeater items until at least one repeater item exists for a given page and field. This can drastically reduce the number of pages consumed by repeaters in your system, and even more so if you are nesting repeaters. Eventually, this will become the default setting, but for now we are playing it safe and making it optional with a new toggle that you'll find on the Details tab when editing a repeater or matrix field:

repeater-storage.png

After enabling the "Use fewer pages..." Setting, the "Find an optionally delete unnecessary pages" checkbox will take care of cleaning up anything that isn't necessary for existing repeaters already in the database. If you have a large site with a lot of repeaters, this could be deleting a lot of now irrelevant stuff, so just be aware of that and backup ahead of time to be safe. Thanks to @Jonathan Lahijani for the idea/suggestion. 

Also new this week is the ability to copy and paste repeater items, as well as to clone above or below existing items. It handles this by replacing the existing "clone" icon action with a dialog that now lets you choose among various related actions. Among them is the ability to copy/paste from the same page or between different pages. The only requirement is that the repeater (or matrix) items are from the same field.  See the video below for an example of how this works:

This works with either Repeater or Repeater Matrix fields. But if you want this feature in Repeater Matrix, you'll want to upgrade to ProcessWire 3.0.188 and download the new version posted today (v8 beta) in the ProFields download thread. The ability to copy/paste repeater items was an idea originally from @David Karich and a module he developed called Repeater Matrix Item Duplicator. Thanks for reading and have a great weekend!

  • Like 18
  • Thanks 4
Link to comment
Share on other sites

I just re-read the previous post. It is what i did ask for not knowing we already have it)

Could you please consider also allowing to put color code in that item headers string, so we can also define a per-type color? That would make different types really stand out)

  • Like 4
  • Thanks 1
Link to comment
Share on other sites

@ryan - lots of fantastic improvements - thank you very much!

One thing I have started seeing (before this latest PW dev and RM versions, so not completely new), are errors like this:

  • Please choose a different name for matrix type “icon_grid” as this name is already in use by a field.
  • Please choose a different name for matrix type “buttons” as this name is already in use by a field.
  • Please choose a different name for matrix type “reusable_block” as this name is already in use by a field.
  • Please choose a different name for matrix type “selected_testimonials” as this name is already in use by a field.
The weird thing is that I wasn't prevented from creating the fields (or the RM subfields), so the conflict checking isn't working until it's too late. The other thing is that it doesn't seem to actually break anything - is there actually a need to show these errors? What actually is the problem with having these duplicate field / RM subfield names?
 
Link to comment
Share on other sites

2 hours ago, adrian said:

@ryan - lots of fantastic improvements - thank you very much!

One thing I have started seeing (before this latest PW dev and RM versions, so not completely new), are errors like this:

  • Please choose a different name for matrix type “icon_grid” as this name is already in use by a field.
  • Please choose a different name for matrix type “buttons” as this name is already in use by a field.
  • Please choose a different name for matrix type “reusable_block” as this name is already in use by a field.
  • Please choose a different name for matrix type “selected_testimonials” as this name is already in use by a field.
The weird thing is that I wasn't prevented from creating the fields (or the RM subfields), so the conflict checking isn't working until it's too late. The other thing is that it doesn't seem to actually break anything - is there actually a need to show these errors? What actually is the problem with having these duplicate field / RM subfield names?
 

@adrian That issue has been there for a couple years.  I spoke about it with Ryan on a thread in the RM forum, but I can't find it.  You can ignore those errors.  I do however wish they would not appear since it feels like like a bug.

  • Like 2
Link to comment
Share on other sites

Just pushed PW 3.0.188 and the RepeaterMatrix v8 beta to a side-project as it's a nice testing ground for this and it works perfectly fine. No errors or problems so far.

The new icon option makes it super clean - if you want.

rm8.png.f712e188a2bde48a2dd1ddf91df18396.png

Yet and empty entry with just an icon came up each and every time I updated the RepeaterMatrix field, even when I just opened it.

rm8settings.png.b0381666ed2628fdd5ab491a1c171500.png

 

  • Like 2
Link to comment
Share on other sites

@adrian @Jonathan Lahijani Consider those warnings to just be strong suggestions. If you want to ignore them, it's likely okay, but for most (including me) I would avoid colliding repeater matrix type names with field names because it's a source of confusion. I think I had also identified a case where it could a problem. I don't remember exactly what it was, but do remember it was possible enough to warrant displaying warnings about it, but unlikely enough to be okay to ignore if everything otherwise works. 

@wbmnfktr Turns out thats a leftover debugging/development message which is blank because the value it's showing is empty unless you use the images feature. It should only appear when editing the matrix field (Setup > Fields) and is okay to ignore. I'll make sure it's removed in the next update. Thanks.

  • Like 5
Link to comment
Share on other sites

On 10/29/2021 at 1:24 PM, ryan said:

Also new this week is the ability to copy and paste repeater items, as well as to clone above or below existing items. It handles this by replacing the existing "clone" icon action with a dialog that now lets you choose among various related actions. Among them is the ability to copy/paste from the same page or between different pages.

Hi @ryan. I was thinking, would it be possible to enhance this feature so that you could copy multiple repeater items to memory and paste them at once (and respect copied depth as well)?

  • Like 2
Link to comment
Share on other sites

16 hours ago, BrendonKoz said:

Out of curiosity, for file/image fields, are the copied values going to point to the originating pagefile URL, or is it creating a completely new physical copy of the source items on the page where the repeater is pasted?

In my setup it's a reference to the already existing file on another page (the origin).

Link to comment
Share on other sites

19 minutes ago, wbmnfktr said:

In my setup it's a reference to the already existing file on another page (the origin).

Presumably that means that the copied item is broken if the original is deleted? Or is there a safeguard in there somewhere?

Link to comment
Share on other sites

Yes and no.

In my first test I added an image from the global image field (in the template, not in the RepeaterMatrix) to a textarea.

I copied that textarea over to another page and the image was referenced.
I deleted the origin (master-repeater) and the image was removed on the second page as well. Not broken due to the clean-up process in my textareas.

In my second test I created a new repeater type with an image field.
Added one to a page.
Copied it over to another on and the image was moved over to an all new repeater-page (first repeater had ID 8083, second had ID 8084).

  • Like 2
Link to comment
Share on other sites

  • 9 months later...
  • 4 weeks later...
On 8/26/2022 at 11:15 AM, AndZyk said:

@Roych

You can clear the copy/paste memory in the select options, but yeah I think the memory could clear itself after for example loggin out.

I think no one needs something forever in the memory. ?

Hello, where is this option, I somehow can't find it? Thank you. ?

Forget it I found it, thx ?

Edited by Roych
Found the solution ;)
  • Like 2
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...