Jump to content

Recommended Posts

Posted

Hi,
I want to extend PagesType to get a new `Product $products` variable in the API. Problem is, I have about a million (well, about 50) different templates for the products so `addTemplates()`  can be difficult. Without a template, `pagesType` throws notices (`Trying to get property of non-object in wire/core/PagesType.php on line 161`). Is there a way to extend `pagesType` without specifing templates or by specifying a template group?

Thanks, thomas

 

Posted

Thanks @rickI saw that. I now label all my templates "product" and use `$this->addTemplates(\Processwire\wire('templates')->find("tags=product"));`

 

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
×
×
  • Create New...