Jump to content

ProcessPageHidden and ProcessPagePublish


geniestreiche
 Share

Recommended Posts

A few days ago some of us discussed the philosophy behind the action links in the contao/pw-tree (http://processwire.c...-love-pws-tree/). Sometimes i found it useful in contao to have a shortlink to publish/unpublish a page. So i came up with the idea to make a module for this task.

I wouldn't call me a programmer so i take the code from ryan's pageprocessclone (http://modules.proce...ess-page-clone/) an nico's pageprocessdelete (http://modules.proce...ss-page-delete/) as a starting point. thank you for your great work.

Both modules adding a link to the page list.

ProcessPageHidden adding a "hidden" link to the list and changes the status of a page to hidden/unhidden.

https://github.com/g...ocessPageHidden

post-586-0-30001400-1350306261_thumb.png

ProcessPagePublish adding a "publish" link to the list and changes the status of a page to publish/unpublish.

https://github.com/g...cessPagePublish

post-586-0-00297300-1350306271_thumb.png

Maybe someone would find it useful too and there are not so much bugs in the code.

  • Like 5
Link to comment
Share on other sites

  • 5 months later...

Hi geniestreiche,

Thanks for these modules.

I was wondering if it would be better to toggle the pageListActionLabel labels depending on the status of that page. So, show label "hide" if page is not hidden and show "unhide" if page is hidden. Same for the published status, i.e. show "publish" if page is not published and "unpublish" if page is published. Visually, this makes more sense to me. I am no coder but I've made quick dirty hacks in local copies of the module to do just this. See attachment. I'm sure your code will be cleaner than mine ;).

Many thanks.

Cheers

/k

post-894-0-36110900-1365325962_thumb.jpg

  • Like 3
Link to comment
Share on other sites

hi kongondo,

yes your suggestion make sense. first i thought the changes on the page title were enough (color, line-through). but maybe the toggle of the label is one step smarter  :cool:.

i updated the repos on github. i don't know whether the code changes are efficent than i am not a coder too  :blink:.

greetings...

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

I just added the line

$page->status = Page::statusHidden;

to the ___install() method of the plugin. This prevents the page from being displayed in the sub menu of the Pages item of the editors main menu.

I'm using ProcessWire v2.6.1.

Link to comment
Share on other sites

I just added the line

$page->status = Page::statusHidden;

to the ___install() method of the plugin. This prevents the page from being displayed in the sub menu of the Pages item of the editors main menu.

I'm using ProcessWire v2.6.1.

The latest version of PW has built-in hide/unhide and pub/unpub action buttons, so I don't actually think there is a need for this module anymore.

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