Reputation: 1164
I am trying to create a theme using Prestashop 1.6 and the Default theme as reference.
Whenever i try
{HOOK_TOP}
in my header.tpl , it display the search,cart modules.
But in my case i just want the search module to be displayed.How can i display only the search block and the signIn,create account i want them to be displayed in another place.
Also can i get any advice or tutorials from where i can learn the theming the right way.I guess i am doing stuff the wrong way.
Upvotes: 0
Views: 446
Reputation: 78
You can create new hooks for each module you want to display elsewhere.
By default, the blocks you don't want are hooked to TOP.
You need to un-hook those from TOP. Create new one : - sql :
INSERT INTO ps_hook (name,title,description,position,live_edit) VALUES ('yourNewHook','title of your new hook', 'description of your new hook', '1', '1');
INSERT INTO ps_hook_alias (alias, name) VALUES ('the alias of your new hook','yourNewHook');
controller :
public function hookYourNewHook ($param) { if (!$this->_prepareHook($param)) return; return $this->display(FILE, 'templateofyournewhook.tpl');}
Modify or add a register hook in public function install() : $this->registerHook(' alias of your new hook')
Now you can call your hook in a tpl with {hook h="yourNewHook"}
Upvotes: 1