as I discussed in the look and feel topic, i need to change the css class for the categories ammount of products present.
i can either modifiy the tpl file and had code the new class name (even if using logic)..
OR I can modify the tpl file and add a hook around the class string and then add the info
in the hook file...
which i have done both now...
but the hook implementation filename is confusing to me
here is the change in the categories_tree.tpl file (which is an override of the original)
{hook name="categories:categories_amount_class"} class="badge" {/hook}
and the implementation of the hool is in
??addon_name??/hooks/categories/categories_amount_class.override.tpl
is the .override. because it wants/needs to extend the file, BUT the file is overridden??
so without the override, then the hook filename would be
??addon_name??/hooks/categories/categories_amount_class.tpl
so, because i KNOW i have an override, then i have to explicitly hook the override.. else it would try to hook the base (if there was a hook clause)
I never saw this documented anywhere... or just didn't get the extent of the architecture...
is my understanding right? did I miss something in the doc?
Good day,
To override hook content use the following file
design/backend/templates/addons/ADDON/hooks/categories/categories_amount_class.override.tpl
To add class before hook content use
design/backend/templates/addons/ADDON/hooks/categories/categories_amount_class.pre.tpl
To add class after hook content use
design/backend/templates/addons/ADDON/hooks/categories/categories_amount_class.post.tpl
P.S. If override.tpl is usedm pre.tpl and post.tpl files are ignored
thanks. but
>To override hook content use the following file
>design/backend/templates/addons/ADDON/hooks/categories/categories_amount_class.override.tpl
there was no hook already implemented that needed to be overridden
I DO have an override,
design/backend/templates/addons/ADDON/overrides/views/categories/components/categories_tree.tpl
so i am providing the hook defined in the override.
which implements a hook...
this is my second override which implements a hook... the first did NOT need the .override. extension,
I am trying to understand the required order.
in my first case I have an override
(both in design/backend/templates)
/overrides/views/products/update.tpl
and the hook is
/hooks/products/additional_product_codes.post.tpl
in the second case
/overrides/views/categories/components/categories_tree.tpl
and the hook is
/hooks/categories/categories_amount_class.override.tpl
naming it /hooks/categories/categories_amount_class.post.tpl does not work
so, I still don't understand the rules..
If you override the whole template, there is not need to post hook there. You can insert your code directly in the overriden file. But before overriding the whole template, make sure that it does not have hooks in the required place. So it is recommended to use built-in hook instead of overriding the files