TITNFE: Template in theme not found error

Sometimes your template in your theme is not found. Why?

You have a module and want to overwrite the template in your theme. No problem, works out of the box, cause theme specific templates overrule module templates. That's fine.

But when your module is "mysite" (or whatever you set as $project in your _config.php), it doesn't work. Because SS_TemplateManifest's method getCandidateTemplate() returns the templates in the following order of importance:

  1. project code (e.g. in mysite)
  2. current theme
  3. and finally modules

So either put your code and the "global" templates (valid for all themes if not overwritten in the theme) in a seperate module  or just move the templates to your theme. But a template in mysite/templates/ is just Stumpf...

Rate this post

Post your comment

Comments

  • Loz Calver 22/02/2017 11:43am (7 years ago)

    Worth noting that (in 3.x at least), CompositeField.ss is never actually used. CompositeField_holder.ss does everything

RSS feed for comments on this page | RSS feed for all comments