ritepac Posted February 21, 2013 Share Posted February 21, 2013 Bonjour, • Version : 1.5.2 Je souhaiterais ajouter un nouveau hook et attribuer le module categories à ce nouveau hook. Je parle là que de hook de positionnement. Au lieu de l'avoir dans la colonne de gauche, je veux créer un hook qui le mettra en absolute left. J'ai regarder tuto etc. Aucun n'est identique et aucun ne fonctionne pour ma part. Si quelqu'un peut m'aiguiller. Voilà ce que j'ai fais : • fichier header.tpl : <div id="fixedLeft" style="position:fixed; top:150px; left:-10px; z-index:30; background:red; height:300px; width:200px;"> {$HOOK_FIXED_LEFT} </div> • INSERTION BDD : [b][i]INSERT INTO pss_hook ( name, title, description, position, live_edit) VALUES ( 'displayFixedLeft', 'Fixed Left', NULL, 1, 1);[/i][/b] • SUR ADMIN : j'ai essayer de greffer le module blockCategories sur mon nouveau hook (qui apparait bien dans la liste) mais rien à faire il n'en veut pas. Bien à vous. Link to comment Share on other sites More sharing options...
ritepac Posted February 21, 2013 Author Share Posted February 21, 2013 (edited) J'avance : Reflexion : J'ai l'impression que pour de nouveau hook, le nom displayFixedLeft ne fonctionne pas mais fixedLeft fonctionne. Donc j'ai bien réussi à accrocher mon module blockcategories à mon nouveau hook fixedLeft. Cependant il ne m'affiche rien dedans. • j'ai ajouté en plus dans le fichier www/modules/blockcategories/blockcategories.tpl : public function hookFixedLeft($params) { return $this->hookLeftColumn($params); } Où ai-je manqué quelque chose ? Bien à vous. Edited February 21, 2013 by ritepac (see edit history) Link to comment Share on other sites More sharing options...
SMorillon.com Posted February 21, 2013 Share Posted February 21, 2013 Bonjour, Il faut indiquer à smarty le contenu de ce hook. Pour celà, il faut overrider la class FrontController, displayHeader et modifier le code pour qui soit comme cela (v1.4.9) : self::$smarty->assign(array( 'HOOK_HEADER' => Module::hookExec('header'), 'HOOK_TOP' => Module::hookExec('top'), 'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn'), 'HOOK_FIXED_LEFT' => Module::hookExec('fixedLeft') )); 1 Link to comment Share on other sites More sharing options...
ritepac Posted February 21, 2013 Author Share Posted February 21, 2013 (edited) [RESOLU] Merci, ça fonctionne. J'arrivais pas à trouver cet assign C'est chose faite et ça fonctionne. Merci infiniement. Merci ça fonctionne P. Edited February 21, 2013 by ritepac (see edit history) Link to comment Share on other sites More sharing options...
J. Danse Posted February 21, 2013 Share Posted February 21, 2013 Et donc, comme je me le faisais remarquer pas plus tard qu'hier: il est grand temps que je modifie la doc à ce propos, qui est une éresie pour la 1.5. Voilà déjà des éléments de réponse: http://www.prestaedit.com/content/8-l-ajout-de-nouveaux-hooks http://www.prestaedit.com/content/12-la-balise-hook-dans-vos-templates Je vous en prie, prenez les en compte Link to comment Share on other sites More sharing options...
J. Danse Posted February 21, 2013 Share Posted February 21, 2013 Voici, donc: http://doc.prestashop.com/display/PS15/Diving+into+PrestaShop+Core+development#DivingintoPrestaShopCoredevelopment-Hooks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now