Jump to content

Recommended Posts

Posted

Hello

I wrote a module with a hook in page render. The problem is that the hook works also when page are "rendered" in lister.
Is it possible to isolate the page render only to the single page view?

thanks

Posted

You can check whether page rendered in admin if so, do nothing.

	if (strpos($_SERVER['REQUEST_URI'], $this->wire('config')->urls->admin) === 0 || $this->wire('page')->template->name == 'admin') return;
  • Like 3

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...