Jump to content

Preset new subpages as hidden


zitzko
 Share

Recommended Posts

Hi hajo,

per default new pages have a status unpublished. You can edit them multiple times and still save them as unpublished.

You should have a [ save + keep unpublished ] button two times (top and bottom) when first editing a page and a [ publish ] button only one time at the bottom.

If this is not enough for your needs, I think you have to create a few lines of code that hook into an event when a new page is created and do this setting there.

Edited by horst
Link to comment
Share on other sites

Hi horst,

thanks for your answer, but I chose the wrong word. Instead of unpublished I wanted the page set as hidden, not having to check "hidden" each time I, or the customer creates a new page.

If this could be done with a hook I'll try this, otherwise I take the hidden parent page.

Hajo

Link to comment
Share on other sites

As far as I know:

  1. A hidden page does not make it invisible. If one has the URL AND the page has a template file AND the page is not a child or other descendant of the Admin page AND the page's "who can access this page?" setting allows guest role to view it, the page can be viewed on the frontend via its URL
  2. A hidden page status does not cascade to its children...a child of a parent with a hidden page status can be viewed too!
  3. The hidden status only blocks the page from searches and lists (e.g. selector; but can be overridden with include=all or include=hidden)
  4. Unpublished pages cannot be viewed via their URL
  5. Children of unpublished pages are still visible via their URL.

Then again, you probably know all these already... :)

References:

http://processwire.com/api/selectors/#access_control

http://processwire.com/api/variables/pages/ - scroll to "NOTE ABOUT ACCESS ROLES AND PAGES"

Link to comment
Share on other sites

Edit....if those sub-pages will never be published, then, via their template (the sub-pages), you can remove guest role view....that way, whether published or not, guest role (the world) will never be able to view them...

setup/templates/ access tab - then "do you want to manage view and  edit access..."  - select yes. Then, under "what role can access....", deselect guest under view pages. Save and you are done....You can always change the settings or move sub-pages that you want to be viewable to another (similar/clone) template...

Above can be done in combination with limiting children of the parent whose sub-pages you want to control to only be able to use your particular template with the access controls (as explained above...) - "allowed template(s) for children" under setup/templates/ family tab...

Edited: additions + clarified stuff.

Edited by kongondo
  • Like 1
Link to comment
Share on other sites

Thanks kongondo,

sometimes it is hard for a non native speaker to bring it to the point ;) ...

I just wanted to know, if there is a way to have the checkbox for status/hidden already been checked (of course only when needed) when I start a new page. This would be fine, for I forget this once in a while.

hajo

  • 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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...