Jump to content

Template file in other folder than /site/template


---
 Share

Recommended Posts

I have a hook to change the template file on a certain page. This is not working at the moment for some reason.

The usual location to place templates is under /site/template. Because the template should only be available in my module, I want my template file to be in /site/modules/mymodule/view/mytemplate.php

When I place my file in the usual template location, it works fine. But when I place the file in my module folder, it doesn't work. When I var_dump the $page->template->filename variable, the location of the template file is correct and maps to my module folder. So everything seems to be correct, but somehow it's not working but I can't figure out the problem.

 

Does anyone know how to solve this?

Link to comment
Share on other sites

  • 1 year later...

Hi @dragen, 

I write a module which creates a hidden page and template. The template file needed for the hidden page to display should be stored in site/modules/MyModule/templates/MyTemplate.php instead of the site/templates path.

 

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

×
×
  • Create New...