I'm sure this is easy but the answer has escaped me. On a drupal install CiviCRM is installed at: /webtree/mysite/htdocs/sites/www.mysite/modules/civicrm

I have a Custom Template File directory set to /webtree/mysite/htdocs/sites/www.mysite/files/civicrm/templates

I'd like to store a custom template file "someText.tpl" in the Custom Template File directory that, depending on some logic, may get included in the Online Event Registration system workflow message using the command:

{include file="someText.tpl"}

If I place the file at: /webtree/mysite/htdocs/sites/www.mysite/modules/civicrm/templates/someText.tpl it is read just fine, but I haven't been able to find a way to place it at /webtree/mysite/htdocs/sites/www.mysite/files/civicrm/templates

I've tried assorted dot notation, full paths, etc. but can't seem to read and include a template that isn't in the module/civicrm/templates path. I'd rather not store my custom files there because it creates extra steps during upgrades. Any suggestions?

  • In your second last paragraph, both paths are the same. Maybe the first should point to the module template path. – Kainuk - CiviCooP Mar 26 '18 at 20:57
  • If you look close they're a little different, the first is INSIDE the default install location for CiviCRM (sites/mysite/MODULES/civicrm.. while the second is outside that location (sites/mysite/FILES/...UPDATE You're right, I typed it wrong. edited now. – Jeff Wood Mar 26 '18 at 21:43
  • Are your Directories and Resource URLs correctly set? – petednz - fuzion Mar 27 '18 at 18:34

You can find some information about overriding templates and the Custom Template Directory in the developer guide here... along with the recommendation that you don't do that but use extensions instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.