Jump to content

hide pages from admin tree


diegonella
 Share

Recommended Posts

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

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