Template Hook Name Confusion

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


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


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


To add class before hook content use


To add class after hook content use


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


there was no hook already implemented that needed to be overridden

I DO have an override,

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)


and the hook is


in the second case

and the hook is

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