TPL or template hooks are parts of a template enclosed in the tags:
{hook name="section:hook_name"} ... {/hook}
that can be supplemented or completely redefined by any add-on.
This is an example of a template hook from the design/backend/templates/views/order_management/components/totals.tpl file:
{hook name="order_management:product_info"} {if $cp.product_code} <p>{$lang.sku}: {$cp.product_code}</p> {/if} {/hook}
TPL hooks are used to show additional data in an existing template. For example, if an add-on collects some data that should be shown in the store administration panel in a separate block, this block can be added using a TPL hook.
Unlike PHP hooks, template hooks should not be declared explicitly. A proper file naming and placing will do the trick.
The naming algorithm is as follows:
It is possible to fully override a template in an add-on. To do it:
For example, the design/backend/templates/addons/[addon id]/overrides/views/index/index.tpl file will fully override the following template: design/backend/templates/views/index/index.tpl
Questions & Feedback
Have any questions that weren't answered here? Need help with solving a problem in your online store? Want to report a bug in our software? Find out how to contact us.