kixe Posted December 8, 2014 Posted December 8, 2014 (edited) New Module which adds 1 more, but very tiny green buttons to the page list. It saves minimum 3 klicks to change page status from hidden to visible.Edit: update 11.12.14Module provides up to 3 (more) buttons in page list to toggle status (hidden/visible, published/unpublished and locked/unlocked).Enable/Disable the buttons in the settings (screenshot) ProcessPageStatusToggler.module Edited December 11, 2014 by kixe 9
kongondo Posted December 8, 2014 Posted December 8, 2014 @Kixie, Nice effort! Thanks. Not sure you know we already have a similar module? http://mods.pw/2y - ProcessPageHidden and one for un/publish - http://mods.pw/2z - ProcessPagePublish Btw, both yours and the ones I linked to are not really Process Modules 1
adrian Posted December 8, 2014 Posted December 8, 2014 Looks very handy - thanks! A few minor comments: I don't see why it requires LazyCron I think you have the messages reversed - it says "Changed page status to 'hidden'" when it should say "visible" It would be nice if the message told you what page had its status changed I'd love to see this work via ajax, rather than a page refresh, or at a minimum, it would be great if the EDIT / VIEW etc links were turned on for that page after the reload I am not sure whether the obscurity of the tick/cross is really worth the reduced space usage - I would rather see hidden/visible, but maybe that's just me. Thanks again! 2
kixe Posted December 8, 2014 Author Posted December 8, 2014 It doesn't require LazyCron. Thats a copy paste bug . Thanks Adrian for the comments. I put it quickly together. Polishing will come soon. Thanks 1
kixe Posted December 8, 2014 Author Posted December 8, 2014 @Kixie, Nice effort! Thanks. Not sure you know we already have a similar module? @kongondo. I saw that coming but didn't search enough in the growing modules directory.
adrian Posted December 8, 2014 Posted December 8, 2014 Sorry - I figured the lazycron was a typo - I should have phrased my comment as such I have another thought for you which I think is important. You are setting the status directly as statusHidden and StatusOn, but really you should be using addStatus and removeStatus to add/remove Page::statusHidden Otherwise you will override unpublished, locked etc.
kixe Posted December 9, 2014 Author Posted December 9, 2014 made some changes. Implements now publish/unpublish button too. Enable/ disable buttons via modules settings.@adrianThanks. I changed this. 2
Soma Posted December 9, 2014 Posted December 9, 2014 Do we really need two version of the same module?
kongondo Posted December 9, 2014 Posted December 9, 2014 I'd say we don't. Maybe @kixie can collaborate with @geniestreiche to enhance the existing module(s)? Whilst I wouldn't want to discourage the enthusiasm of budding module developers, I'd say this is something we need to carefully consider and strike a good balance about. There's enough lessons from our neighbours Drumlapress about this . Just saying.. 1
Martijn Geerts Posted December 9, 2014 Posted December 9, 2014 Kixe, I really appreciated the effort you made here and I'm in total agreement here with Kongondo. Maybe it's even possible to take the lead on a combined Module as I haven't seen geniestreiche for a while.
kixe Posted December 9, 2014 Author Posted December 9, 2014 (edited) @Somano we don't.@Martijn GeertsIts already done. I updated it and included lock/unlock button too.@kongondoWhen I started with the module I didn't know about the one from geniestreiche. I startet on the base of Nicos ProcessPageDelete.module.I will not put it in the modules directory. I am open to merge the results with geniestreiche.Sent him a message. Edited December 9, 2014 by kixe 3
kixe Posted December 9, 2014 Author Posted December 9, 2014 Btw, both yours and the ones I linked to are not really Process Modules Thats a question of philosophie. This module creates a page with a process field (which calls the module). This module hooks in ProcessPageListRender Changing the page status is a process In a way you are right: this module is not a process itself, but it executes one. Any suggestions for a better name? Something like HookProcessPageStatusToggler.module? I am often thinking about a straight naming syntax for modules. I have no idea ...
teppo Posted December 11, 2014 Posted December 11, 2014 @kixe, have you seen this thread already: https://processwire.com/talk/topic/741-a-guideline-for-module-naming/? That's a good start, especially when it comes to "reserved module names", though for something like your module it doesn't exactly give any foolproof answers. 2
doolak Posted September 9, 2015 Posted September 9, 2015 Is this module still available and working with the newest PW release? Couldn't find it in the modules list.
kixe Posted September 9, 2015 Author Posted September 9, 2015 No it is not in the modules directory.Read here: https://processwire.com/talk/topic/8508-page-status-toggler/?p=82345By the way there exists a built-in functionality, which makes my and the modules of geniestreiche obsolete.if you still want to use it you can download it by clicking the link in the first post. It should work with the newest PW releases. 1
doolak Posted September 9, 2015 Posted September 9, 2015 By the way there exists a built-in functionality, which makes my and the modules of geniestreiche obsolete. Where can I activate this?
kixe Posted September 9, 2015 Author Posted September 9, 2015 it is already activated under the following conditions: not available for 'home' ($page->id == 1) not available for 'admin' ($page->template == 'admin') page editable status is needed to show lock/unlock current user needs page-lock permission trash/restore button only available for superuser functionality disabled in demo mode If you like to have a deeper view have a look in the script: /wire/modules/Process/ProcessPageList/ProcessPageListActions.php 1
doolak Posted September 9, 2015 Posted September 9, 2015 Ah, so this feature exists just in the dev branch - not in the stable version, right?
LostKobrakai Posted September 9, 2015 Posted September 9, 2015 Yep, it's part of the 2.6.5 updates: https://processwire.com/blog/posts/extra-action-in-your-page-list-processwire-core-updates-2.6.5/#get-extra-action-from-the-page-list-and-lister 2
doolak Posted September 9, 2015 Posted September 9, 2015 Thanks a lot - have updated and it works fine. At the moment without translation support for the buttons but very nice! 1
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