nik Posted December 13, 2012 Share Posted December 13, 2012 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 ) 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). 6 Link to comment Share on other sites More sharing options...
Soma Posted December 13, 2012 Share Posted December 13, 2012 Sneaky Niki you. I didnt even notice this thead before. Nice! Havent tried but at least a dozen optones are missing. ;-) 2 Link to comment Share on other sites More sharing options...
Joss Posted December 14, 2012 Share Posted December 14, 2012 ooh, I will go look at this in the morning. I am proofreading my first tutorial at the moment and it is making my head hurt. Link to comment Share on other sites More sharing options...
ryan Posted December 17, 2012 Share Posted December 17, 2012 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 More sharing options...
nik Posted December 18, 2012 Author Share Posted December 18, 2012 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. 1 Link to comment Share on other sites More sharing options...
Pete Posted January 6, 2013 Share Posted January 6, 2013 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: 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). 1 Link to comment Share on other sites More sharing options...
ryan Posted January 7, 2013 Share Posted January 7, 2013 Nik, the modules directory now has a version 2.3 option for the requirements, so it's safe to add it whenever you are ready. Link to comment Share on other sites More sharing options...
nik Posted January 9, 2013 Author Share Posted January 9, 2013 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 More sharing options...
Pete Posted January 9, 2013 Share Posted January 9, 2013 Thanks - looking forward to trying out the alternative config Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now