Jump to content

Weekly update – 3 May 2024


Recommended Posts

With the current project that I'm working on, there's eventually going to be an enormous amount of data to edit within it (in ProcessWire), and so I've been looking for ways to optimize and facilitate the editing experience. The goal is to save the people editing as much time as possible, and reduce the number of steps necessary to make common edits. This is what motivated the recent Table field updates. The is also what motivated a new module I'm working on called PageEditChildren.

The PageEditChildren module takes the existing "Children" tab in ProcessWire's page editor and replaces it with a new one that lets you edit all of the child pages inline, directly from the parent page. For specific cases, such as the one shown in this video (below), this provides a more convenient way to edit multiple pages at once. It can significantly reduce the amount of back-and-forth between the page editor and the page list, or multiple page editors, keeping it all in one page editor session. 

Likely you would use this module to replace the "Children" tab on just some (not all) pages. Specifically, pages where the relationship between parent and children is one where they are often edited as a group. This is a fairly common use case in ProcessWire, and one where this module can save you a lot of time. From an editing standpoint, it has a lot in common with repeaters. 

Other modules that have some crossover are PageTable (core) when configured to create/edit children pages, and BatchChildEditor. Both use page editors in modal windows to accomplish editing children, a different approach than PageEditChildren, which keeps it all part of the single page editor. Though BatchChildEditor can edit title and status (hidden/unpublished) inline, and supports CSV export/import options, among other useful tools. All of these modules are worth consideration when there is a need to optimize the editing experience between parent and children.

This is just an early preview of PageEditChildren, so I'm going to work on the module and test it out a bit more before releasing it. But it could be ready to share as soon as next week. Supporting file/image and repeater fields in this module required some minor core improvements, which are in this week's core updates. I'm interested to hear your thoughts on whether this would be useful in your sites as well? More next week. Thanks for reading and have a great weekend!

  • Like 26
  • Thanks 2
Link to comment
Share on other sites

Quote

Would it be possible to edit the 'name' field of a page as well?

@Jonathan Lahijani If you edit your child page template and temporarily enable $config->advanced = true; you can click on the "System" tab and check the box to have it show the "name" field on the content tab, which should do the trick. 

  • Like 2
Link to comment
Share on other sites

Great addition @ryan   Had you thought about dealing with hierarchies in the same way as repeaters? Then there would be almost no need to use the separate children tab. 

  • Like 1
Link to comment
Share on other sites

@MarkE There's definitely a lot of potential for this to evolve over time. Another example is that it can edit any pages this way, not just children. For that reason, I put in a hook: ___getChildren($page) so that anyone can override what are the "children" for the page. If there is hierarchy, such as there would be if the selector "parent_id=$page" were changed to "has_parent=$page", then I agree the way repeaters do hierarchy could work here too. But I figure the best bet is to keep it simple, focused and straightforward at first to get to a stable version 1, and then start evolving it to do more after that, if there's interest. 

  • Like 5
Link to comment
Share on other sites

@ryan This is a nice adition! When editing multiple (child) pages it would also be helpful to have a previous/next page button (I know that we have "save + next"). Maybe it could be added next to the title with little arrows. Just my two cents ?

Link to comment
Share on other sites

On 5/11/2024 at 4:15 PM, jploch said:

@ryan sorry I was not very clear. I was talking about two buttons while editing a page, that go to the next/previous page (with same parent)

Thx to @netcarver this is now also included in RockAdminTweaks - a module intended to be a collection of all those little admin tweaks and helpers, easy to enable/disable and easy to develop, see this example (also from @netcarver).

Compared to AOS, which is/was a great module, RockAdminTweaks has all tweaks separated into folders and dedicated files, so both developing new tweaks as well as maintaining existing ones should be a lot easier than with AOS (we even have a GUI for adding new tweaks...).

This is what we have so far:

srU9Ca3.png

And here the prev/next links on page edit (with nice uikit tooltips that appear instantly rather than after a delay):

7ULZnWo.png

Contributions welcome

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

Just want to acknowledge that almost all of the tweaks I've contributed were originally authored by Roland (tpr) as part of AdminOnSteroids - I've just converted the main features I use over to RockAdminTweaks format.

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

16 minutes ago, netcarver said:

Just want to acknowledge that almost all of the tweaks I've contributed were originally authored by Roland (tpr) as part of AdminOnSteroids - I've just converted the main features I use over to RockAdminTweaks format.

Thanks for mentioning this. It's a great module and I've been using it myself for a long time, but @tpr has moved on (last AOS commit was 4 years ago and last login was 08/2023), so I've been trying to build something that allows for a real community effort where everyone can easily contribute. We'll see how it works ? 

  • Like 3
Link to comment
Share on other sites

Quote

sorry I was not very clear. I was talking about two buttons while editing a page, that go to the next/previous page (with same parent)

@jploch The next/previous children pages are actually all present already, so a next/prev is a matter of moving your mouse 40 pixels down or up. But it's possible I still don't understand what you mean in this particular context. I'll try to get a beta of this module ready shortly, and once you've had a look at it let me know if the next/prev that you are thinking of still applies. 

  • Like 1
Link to comment
Share on other sites

@adrian I understand that much, but I can't figure out how that fits into the PageEditChildren output, where next/prev children are already present and visible. 

Link to comment
Share on other sites

1 minute ago, ryan said:

@adrian I understand that much, but I can't figure out how that fits into the PageEditChildren output, where next/prev children are already present and visible. 

Sorry :)

I'll leave @jploch to answer that, but I think the request for these arrows is in the spirit of making editing children easier in general from the main Content view.

  • Like 1
Link to comment
Share on other sites

@ryan It's not really related to the module (which looks really useful), but generally to the problem that you adress with the module, when you have to edit lots of children. With the arrows you would edit one sibling page after another, which is a different use case and for some client might be more intuitive than editing the parent page.

I really liked the feature of the AOS module which is not maintained anymore, so I thought why not ask here. Sorry if it was slightly off topic. I was also not aware of @bernhards module, which seems like a really nice replacement of AOS. I just think it's such a useful feature, that it might make sense to consider it for the core.

 

  • Like 2
Link to comment
Share on other sites

@jploch Ah okay, sorry I misunderstood, I thought you were referring to something for the module. Yes maybe next/prev sibling buttons would be a good addition. I've not used that before, I'll have to check out Bernhard's module that adds them. 

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