Jump to content

PW 3.0.186 – Core updates & repeaters


ryan
 Share

Recommended Posts

It took a little more time this week to wrap up what I was finishing last week (and the week[s] before). But I think it's now at a good spot to move on to something else, and so I started with some Repeater and RepeaterMatrix updates. 

In Repeater, a new feature was added that's been requested for awhile: the ability to add items anywhere you choose. Previously you could do it only by adding items to the bottom, and then drag them in place. Now you can click insert before/after [icons] in each repeater item header and it will add the new item in place. It is also depth-aware. This is something that I think will also be useful especially for people using repeaters for page builder type contexts. (Note: the feature does not [yet] work if you have all Ajax features turned OFF in your repeater settings). 

There's a GIF screencast below that shows you how it works. You can click the "insert before" or "insert after" actions and it inserts a new item in place. Alternatively, if you hover either action for a second, it'll show you where it's going to insert an item and you can click either the the item, or the action, to complete the insertion. There's still likely some optimizations and improvements to make in the JS here but so far it seems to be working well. 

(I made this as a GIF but for some reason IP.Board won't accept it, so here's a YouTube embed instead):

Everything in Repeater also gets inherited by RepeaterMatrix, so you'll find this feature there too. But it's not fully functional there just yet. That's because RepeaterMatrix items also have a "type", so I'm working on a new version of RepeaterMatrix that lets you select a type once you've chosen where to insert the item. Another related feature in progress in RepeaterMatrix at the same time is a dropdown/select option for choosing what matrix type you want to add for items. This is an alternative to the current list of links that appears at the bottom. The dropdown also gives you the option of having groups of related types. More on that soon, potentially next week. Thanks for reading and have a great weekend. 

  • Like 20
  • Thanks 5
Link to comment
Share on other sites

Great news you're working with Repeater/Repeater Matrix once again, @ryan! This new enhancement is superb and in line with the community requests in the Making Repeater Matrix better suitable for content building umbrella topic, specifically with @Zeka's 1st one in this post. Thank you!

10 hours ago, ryan said:

Another related feature in progress in RepeaterMatrix at the same time is a dropdown/select option for choosing what matrix type you want to add for items. This is an alternative to the current list of links that appears at the bottom. The dropdown also gives you the option of having groups of related types.

This is also a quite requested feature, so eagerly waiting on it! Could you please consider adding the ability to override the default mechanism of adding new items, so we could build a nicer UI for it if needed, as described here. Thanx in advance))

  • Like 2
Link to comment
Share on other sites

Quote

This is also a quite requested feature, so eagerly waiting on it! Could you please consider adding the ability to override the default mechanism of adding new items, so we could build a nicer UI for it if needed, as described here. Thanx in advance))

Exactly what I was about to suggest too 😄

Dropdown sounds nice for some use cases, but in my experience what many/most users really need when building page content from blocks is some way to visually identify what each block is/does.

(From that link Ivan posted, I gather that an easy hook to facilitate this already exists, or at least is on its way?)

  • Like 2
Link to comment
Share on other sites

I sometimes add a repeater matrix type that u only want to use under a certain template or part of the page tree - is it possible to limit that already or should I put in a feature request?

Love this post by the way as we also heavily use repeater matrix to build out content using blocks.

Link to comment
Share on other sites

Hi @ryan,
thank you for the update! 

Don't know, if i should rather open a dedicated thread for that, but as it is related to the .186 update:
I am running into some issues with the new "page not available in language" feature. Whilst the normal 404 is working, the 301/302 redirect option throws an error (at least for my current multilingual pw project)

Quote

Method Page::localUrl does not exist or is not callable in this context (in /wire/core/Wire.php line 564)

I could just trace it back to the newly introduced ___pageNotAvailableInLanguage in LanguageSupportPageNames.module. Tbh. as my PHP skills are still kind of lacking, i am not sure, if it is related to my setup or something more general.

  • Like 1
Link to comment
Share on other sites

Quote

This is also a quite requested feature, so eagerly waiting on it! Could you please consider adding the ability to override the default mechanism of adding new items, so we could build a nicer UI for it if needed, as described here. Thanx in advance))

@Ivan Gretsky Hooks have already been added for this, and I think they were present in the dev version I posted in the ProFields board a few months back? I don't remember for sure, but I'm trying to make everything hookable so that people can modify the output as needed, and will keep looking for additional opportunities for that as I build in more related features. 

Quote

(From that link Ivan posted, I gather that an easy hook to facilitate this already exists, or at least is on its way?)

@teppo Yes there's a renderAddMatrixItemLink() hookable method for this, and it renders a link for one matrix item type, and gets called for each of them. So you could change the output to be anything you want. This is already present, but with the changes being made, chances are another hookable method will be added related to this. 

Quote

I sometimes add a repeater matrix type that u only want to use under a certain template or part of the page tree - is it possible to limit that already or should I put in a feature request?

@Pete If I understand correctly, this is already there. See the "Matrix types to allow for adding new items" on the "Input" tab when editing your matrix field. This can be configured in template context which enables you to specify some types for one template and other types for another, etc.

Quote

I am running into some issues with the new "page not available in language" feature. Whilst the normal 404 is working, the 301/302 redirect option throws an error (at least for my current multilingual pw project)

@mlfct Thanks, I was able to reproduce that here too and have pushed a fix on the dev branch. 

  • Like 8
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...