Answers.Body: <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-16T17:41:59.477Z
Answers.LastActivityDate: 2024-11-16T18:05:40.140Z
Answers.LastEditDate: 2024-11-16T18:05:40.140Z
Answers.UserDisplayName: Mike Steigerwald
Answers.Body: <p>I'd say check 2 things:</p>
  <ul>
  <li>You have a recent-ish version of civix and have run civix upgrade.</li>
  <li>That info.xml has the smarty mixin in the <code>&lt;mixins&gt;</code> section. If it doesn't you can add it with <code>civix mixin</code>.
  <ul>
  <li>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).</li>
  </ul>
  </li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-10T18:21:05.320Z
Answers.Text: Do I need to add a <mixins> sections to use the default smarty?
Answers.UserDisplayName: Mike Steigerwald
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-11T00:04:46.563Z
Answers.Text: I think so. Take a look at a couple popular extensions https://civicrm.org/extensions, e.g. https://github.com/veda-consulting-company/uk.co.vedaconsulting.mosaico/blob/b34727ddbb0a04725aedac104ceccd729a905a62/info.xml#L43, https://github.com/eileenmcnaughton/nz.co.fuzion.extendedreport/blob/f0a83518f4ecf6188e5f27998f4eef11265db691/info.xml#L37. And note that civix will add in a mixin folder depending on compatibility version: https://lab.civicrm.org/extensions/civirules/-/tree/master/mixin?ref_type=heads
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-09T21:11:09.893Z
Answers.LastActivityDate: 2024-11-09T21:11:09.893Z
Answers.UserDisplayName: Demerit
Body: <p>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.</p>
  <p>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.</p>
  <p>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.</p>
  <p>How can I get CiviCRM to look for BasePage.tpl in wp-content\uploads\civicrm\ext\extensionbase\templates\CRM\Extensionbase\Page?</p>
  
Tags: <smarty><civicrm.settings.php>
Title: How can I get CiviCRM to look for BasePage.tpl in wp-content\uploads\civicrm\ext\extensionbase\templates\CRM\Extensionbase\Page?
ThreadText: # How can I get CiviCRM to look for BasePage.tpl in wp-content\uploads\civicrm\ext\extensionbase\templates\CRM\Extensionbase\Page?
  
  (Asked by: username_0 on 2024-11-09)
  
  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?
  
  **Tags:** smarty, civicrm.settings.php
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2024-11-16. Score: 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.
  
  
  ---
  
  ### Answer by username_1 on 2024-11-09. Score: 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  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).
  
  > **Comments:**
  > **username_0**: Do I need to add a <mixins> sections to use the default smarty?  
  > **username_1**: I think so. Take a look at a couple popular extensions https://civicrm.org/extensions, e.g. https://github.com/veda-consulting-company/uk.co.vedaconsulting.mosaico/blob/b34727ddbb0a04725aedac104ceccd729a905a62/info.xml#L43, https://github.com/eileenmcnaughton/nz.co.fuzion.extendedreport/blob/f0a83518f4ecf6188e5f27998f4eef11265db691/info.xml#L37. And note that civix will add in a mixin folder depending on compatibility version: https://lab.civicrm.org/extensions/civirules/-/tree/master/mixin?ref_type=heads  
  
  ---
  
  