diff --git a/civi-extension/webform-mw/webform_mw.php b/civi-extension/webform-mw/webform_mw.php index 454a282..6617859 100644 --- a/civi-extension/webform-mw/webform_mw.php +++ b/civi-extension/webform-mw/webform_mw.php @@ -37,6 +37,19 @@ function _webform_mw_staff_key(): string { return is_string($env) ? $env : ''; } +/** + * Implements hook_civicrm_config(). + * + * Registers this extension's `templates/` directory with Smarty so the + * Engagement Report tab page can locate `CRM/WebformMw/Page/Tab.tpl`. + * Without this hook the page callback runs but Smarty has no idea where + * the template lives. + */ +function webform_mw_civicrm_config(&$config) { + $template = CRM_Core_Smarty::singleton(); + $template->prependTemplateDir(__DIR__ . '/templates'); +} + /** * Implements hook_civicrm_xmlMenu(). *