Jump to content

ProcessPageList to only show pages with a specific template?


wheelmaker24
 Share

Recommended Posts

Hi guys,

I'm trying to add some useful admin links to my page like preconfigured ListerPro pages, ProcessPageAdd links and so on.

Is it possible to modify the ProcessPageList to only show pages with a specific template? I've already found a tutorial to modify the PageList to only show items of a specific parent (see here). The easiest way is probably to duplicate the module and modify it, right?

Thanks!

Nik

Link to comment
Share on other sites

I meant the Core module "ProcessPageList", the one showing the page tree on all pages. The link in my initial topic explains how to create quick links within the admin navigation to show specified sub-pages of the page tree. I was looking for something like this that shows the full page tree but only pages with specific templates.

Link to comment
Share on other sites

That's currently not as easy. You can limit the PageList by selecting a parent and only showing that specific branch or just children, but the Page::listable, while being a often requested and discussed thing, is still not working how one would imagine.

You could take a look at how some of the access controlling third party modules are handling the issue.

Link to comment
Share on other sites

a quick&dirty hack could be to use something like this (http://modules.processwire.com/modules/page-list-better-label/) to modify the page label and use some jquery to hide all pages that do not have ##templatexy## in their label

of course that's in no way secure but if you only need some kind of shortcuts that could be a fast solution...

Link to comment
Share on other sites

  • 2 weeks later...

Hi guys,

I'm trying to add some useful admin links to my page like preconfigured ListerPro pages, ProcessPageAdd links and so on.

Is it possible to modify the ProcessPageList to only show pages with a specific template? I've already found a tutorial to modify the PageList to only show items of a specific parent (see here). The easiest way is probably to duplicate the module and modify it, right?

Thanks!

Nik

Hi.

To shop only pages for a specific tepmplate:

Do all steps from link you pointed with some exception:

set process option to ProcessPageLister and in ready.php put someting like 


if($page->template=="admin" && $page->name=="your-page-name") {
    // the initial selector string that all further selections are filtered by
    // this selector string is not visible to user are MAY NOT be removed or changed,
    // except for 'sort' properties.
    $this->set('initSelector', 'template=sometemplate');    
};
?>
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...