diegonella Posted June 17, 2015 Share Posted June 17, 2015 Hello, I am wanting to hide the tree admin certain pages with a specific template, I tried to make a module, but I do not quite understand how to apply the hook This is my code public function init() { $this->addHookAfter("ProcessPageListRender::getPageActions", $this, 'hookPageList1'); $this->addHookAfter("ProcessPageListRender::Execute", $this, 'hookPageList2'); } public function hookPageList1(HookEvent $event) { $page = $event->arguments[0]; if ( $page->template == "familiares" ) { $actions = null; $event->return = $actions; } } public function hookPageList2(HookEvent $event) { $page = $event->arguments[0]; if ( $page->template == "familiares" ) { $event->return = false; } } As I apply the hook? Link to comment Share on other sites More sharing options...
adrian Posted June 17, 2015 Share Posted June 17, 2015 Take a look at this thread: https://processwire.com/talk/topic/1176-hiding-uneditable-pages-from-users/page-2 There are several posts by myself that link to some gists and also an attached module that tackle this from different angles. Regardless you should find something in one of those that will get you sorted out. 2 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