1

I am developing an extension (named extensionbase) for the CiviCRM 5.78 plugin to WordPress 6.6.2. I think that means I'm using smarty5. I store extensionbase in wp-content\uploads\civicrm\ext\extensionbase.

So, BasePage.php is in wp-content\uploads\civicrm\ext\extensionbase\CRM\Extensionbase\Page. BasePage.tpl is in wp-content\uploads\civicrm\ext\extensionbase\templates\CRM\Extensionbase\Page.

From what I can tell using xdebug, CiviCRM correctly finds BasePage.php in wp-content\uploads\civicrm\ext\extensionbase\CRM\Extensionbase\Page. (Debugging also confirms I am using smarty5). However, CiviCRM looks for BasePage.tpl in wp-content\plugins\civicrm\civicrm\templates\CRM\Extensionbase\Page.

How can I get CiviCRM to look for BasePage.tpl in wp-content\uploads\civicrm\ext\extensionbase\templates\CRM\Extensionbase\Page?

2 Answers 2

1

Actually, my issue wasn't specific to smarty. CiviCRM first looks for custom templates, including uploaded extensions, (that's the part I missed), in the Custom Template Directory. Once I set this (I used [cms.root]/wp-content/uploads/civicrm/templates) on civicrm/admin/setting/path, CiviCRM found my extension templates as expected.

0

I'd say check 2 things:

  • You have a recent-ish version of civix and have run civix upgrade.
  • That info.xml has the smarty mixin in the <mixins> section. If it doesn't you can add it with civix mixin.
    • Also then if your compatibility version in info.xml is somewhat old that the mixin folder is present (which gets added by civix mixin or civix upgrade).
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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