Jump to content

Page Status Toggler


kixe
 Share

Recommended Posts

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.
post-1246-0-67465100-1418068303_thumb.jp

Edit: update 11.12.14
Module 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)

post-1246-0-36598500-1418291439_thumb.jp

ProcessPageStatusToggler.module

Edited by kixe
  • Like 9
Link to comment
Share on other sites

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!

  • Like 2
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

@Soma
no we don't.

@Martijn Geerts
Its already done. I updated it and included lock/unlock button too.

@kongondo
When 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. :rolleyes:

 

Edited by kixe
  • Like 3
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 8 months later...

No it is not in the modules directory.
Read here: https://processwire.com/talk/topic/8508-page-status-toggler/?p=82345

By the way there exists a built-in functionality, which makes my and the modules of geniestreiche obsolete.

post-1246-0-32887000-1441785340_thumb.gi

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.

  • Like 1
Link to comment
Share on other sites

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

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