insert a hook in search.tpl

How to insert a hook to override this line of code in the common_templates/search.tpl file, line 28 (2.1.4 CE):


{include file="buttons/go.tpl" but_name="search.results" alt=$lang.search}




What I have in mind is to make it point to a this “go-custom.tpl” file stored in my_changes folder,








Thanks in advance.

search-go-icon.png


{hook name="buttons:custom"}
{include file="buttons/go.tpl" but_name="search.results" alt=$lang.search}
{/hook}




in skins//customer/addons/my_changes/hooks/buttons/custom.override.tpl use


{if whatever condition if you have if any}
{include file="buttons/go.tpl" but_name="search.results" alt=$lang.search}
{else}
src="{$config.full_host_name}skins/basic/customer/addons/my_changes/images/icons/go_custom.gif"
alt="{$alt}" title="{$alt}" class="go-button" />

{/if}

Thank you. I tried but doesn’t work. It doesn’t show any error either.

I’ll try expand the hook to include more declarations, maybe it is because is right in the middle of a if/else

Best regards,

You did clear the cache after adding the hook didn’t you?

Add a {debug} into the top of the hook file. If the debug window displays then you know you have the hook installed correctly. If not, then you don’t.