Jump to content

Module: PageEditRedirects


nik
 Share

Recommended Posts

Edit 2013-01-09:

This module is deprecated - see the next gen version here: http://processwire.com/talk/topic/2515-module-aftersaveactions/

- - -

After following the discussion on multiple save buttons and default action after page save I decided to give it a try. The result (or an early version of it to beat Soma :P ) is a module called PageEditRedirects.

The module, inspired by this post in particular (and another module by adamkiss), adds four options to choose from when saving a page:

  • stay in editor (default)
  • go to the page list
  • add a new sibling page
  • view the edited page

The options are always collapsed and the chosen option is saved into a cookie so that each user's preference will be remembered. Probably should add a checkbox "Remember this setting" (unchecked by default) so that a one-time use of another option doesn't get sticky.

Module can be downloaded from https://github.com/n...geEditRedirects and wont be available from the modules directory just yet (because of the required PW 2.3).

So, consider the module just an alpha version or a proof of concept as it hasn't been tested nearly at all (need to check it doesn't break Antti's Adminbar for example).

Edits:
* Added link to an early post on the subject.
* Added a little more explanation on what the module does and doesn't do.
* Removed the note on needed core changes (Ryan did those already).

  • Like 6
Link to comment
Share on other sites

Great module Nik! I have updated the 2.3 (dev) to have that method hookable. I also made the redirectUrl an argument to the method, just to make it more useful for hooks. Tested out with your module and seems to work great.

Link to comment
Share on other sites

Thanks Ryan! Now I'm able to pass template changes through (by checking redirectUrl) and not mess them up.

Next going to see how to handle new pages and then maybe provide possibility to change the behaviour when saving fields/templates as well. We'll see where I'll end up with this.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

I like this module, but I think I'd prefer it if it was a dropdown box right next to the Save button (I know, you can never please everyone).

I'm sure it's been discussed before, but this works exceptionally well in MODx:

post-1-0-78569200-1357474929_thumb.jpg

It could look like this:

[save] and [continue editing] - remember this option? [x]

Then maybe the only other suggestion I have would be to set two options in the module config to select for it to appear next to the Save button at the top or bottom.

This is also something I'd vote for making its way into the core as it is so useful and I don't think that it adds confusion if the language for the options is clear (which it is).

  • Like 1
Link to comment
Share on other sites

I started a new thread on this modules new version as the name changed. See here: http://processwire.com/talk/topic/2515-module-aftersaveactions/.

@Pete: I'm planning on implementing what you're suggesting as an alternative for the container way. Tried it out already and it shouldn't become a problem.

@Ryan: Great! Although I took a slightly different route and the new version now works in PW 2.2 as well =).

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