Jump to content

Hide Pages


PWaddict
 Share

Recommended Posts

4 minutes ago, kongondo said:

???. Hmm, aren't admin pages hidden for non-superusers by default?

They are still visible. For example I have a hidden page that's used for AJAX on the Shopping Cart page. Even though the status of that page is hidden it's still visible on admin area. With this module I can hide it from the admin navigation by selecting it's template.

Link to comment
Share on other sites

13 minutes ago, PWaddict said:

They are still visible. For example I have a hidden page that's used for AJAX on the Shopping Cart page. Even though the status of that page is hidden it's still visible on admin area. With this module I can hide it from the admin navigation by selecting it's template.

I get you now. You are not talking about ProcessWire /admin/child/....(i.e. children of Page with ID 2) but hidden pages in general. In that case, the module class name, title and description are misleading IMHO. Maybe change to something else?

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

17 minutes ago, kongondo said:

I get you now. You are not talking about ProcessWire /admin/child/....(i.e. children of Page with ID 2) but hidden pages in general. In that case, the module class name, title and description are misleading IMHO. Maybe change to something else?

You're right. The module has been updated to 1.0.1.

Changelog

1.0.1 (31 March 2018)

  • Module renamed to prevent confusion

 

  • Like 2
Link to comment
Share on other sites

Hey @PWaddict! Thanks for the module. Today I found a use case for it. I have a lot of pages with a certain template under root which pollute the Page Tree and make other pages hard to find. They are there for the sake of pretty URL structure. I wanted them to be hidden even for superuser (the one who struggles the most in admin area :rolleyes:), so I removed

$this->user->isSuperuser()

from the code.

I spotted something that looks like a bug and a chance to improve the module. Pagination and the ">More" button still count all the pages, including the hidden ones. Maybe there is a chance to fix it?

Link to comment
Share on other sites

29 minutes ago, Ivan Gretsky said:

so I removed


$this->user->isSuperuser()

from the code.

In that case, it's probably useful to show a PW warning notice for Superusers that some pages are hidden even for them. You might get tired of seeing the warning though :-)...but that can be set to show once per login session I suppose.

  • Like 2
Link to comment
Share on other sites

@Ivan Gretsky I'm glad that you're using it. Unfortunately I don't know how to remove the hidden pages from the count. If someone can do it please send me a PR.

I do not suggest hiding the pages from the Super user cause it might be annoying if you might need to edit them in the future.

Link to comment
Share on other sites

  • 2 years later...

Thanks for the module PWaddict, very useful for my current use case.

I'm building a site with numerous roles, none of which have access to the admin panel as everything is done through the API and front-end editing.

I had to enable view access for some templates, so the only 'look-in' to the top level page tree is through a trusted user adding a link in CKEditor fields.

It's nice to have a module that focuses simply on the main page tree, so I can still define page reference fields for hidden templates where the role still has view access, and they display fine.

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