zitzko Posted March 3, 2014 Share Posted March 3, 2014 Hi folks, is it possible to have new subpages set as "hidden" by default, just to prevent unwanted publishing of a page, or is it better to use an additional hidden page as parent? hajo Link to comment Share on other sites More sharing options...
horst Posted March 3, 2014 Share Posted March 3, 2014 (edited) 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 March 3, 2014 by horst Link to comment Share on other sites More sharing options...
zitzko Posted March 3, 2014 Author Share Posted March 3, 2014 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 More sharing options...
kongondo Posted March 3, 2014 Share Posted March 3, 2014 As far as I know: 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 A hidden page status does not cascade to its children...a child of a parent with a hidden page status can be viewed too! The hidden status only blocks the page from searches and lists (e.g. selector; but can be overridden with include=all or include=hidden) Unpublished pages cannot be viewed via their URL 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 More sharing options...
kongondo Posted March 3, 2014 Share Posted March 3, 2014 (edited) 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 March 3, 2014 by kongondo 1 Link to comment Share on other sites More sharing options...
zitzko Posted March 3, 2014 Author Share Posted March 3, 2014 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 1 Link to comment Share on other sites More sharing options...
kongondo Posted March 3, 2014 Share Posted March 3, 2014 Aaah, I see. sorry for my rumblings then....In that case, like Horst said, you would need a hook, maybe in an autoload module... Link to comment Share on other sites More sharing options...
zitzko Posted March 3, 2014 Author Share Posted March 3, 2014 Hi kongondo, so I see, there's another thing for me to learn ... Thanks Link to comment Share on other sites More sharing options...
kongondo Posted March 3, 2014 Share Posted March 3, 2014 This should get you started... http://processwire.com/talk/topic/2331-doing-additional-logic-after-saving-a-new-page/?p=21881 1 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