Jump to content

Moving Hooks to product.tpl and category.tpl


Recommended Posts

I have moved my RIGHT HOOK to my product.tpl file instead of footer to allow for a different design style however it does not display. Is there a reason why it would not? Or do I need to change another line of the code?

 

I did not think moving it from the footer to product.tpl would make a difference...

Link to comment
Share on other sites

For the hook to be displayed, the $HOOK_RIGHT_COLUMN Smarty variable needs to be set by Module::hookExec() *before* the template that references it is loaded up. I am not sure with 1.4.8 but previously this happened in FrontControllerCore::displayFooter() which is normally called *after* product.tpl will have been loaded. You can move most hook placeholders within a single template but moving them between templates would require larger changes (class overrides at the least).

 

So if you want to move the entire right column hook somewhere else you are looking at adding a class override I expect. That is possible but should not normally be necessary. Instead of doing that, it makes more sense to just transplant the relevant events currently associated with the right column to whatever hook makes more sense for your case (i.e. one that gets set during the product template rendering process).

 

Events associated with the various hooks can be moved around via the backoffice (I forget where but probably under modules).

 

Cheers

Link to comment
Share on other sites

  • 2 months later...
×
×
  • Create New...