limera1n Posted April 19, 2021 Share Posted April 19, 2021 Hi all, in the old Presta store I need to take the newsletter module to the "displayHome" hook and rebuild it visually. In blocknewsletter.php I added: to the constructor: if (!$this->isRegisteredInHook('displayHome')){ $this->registerHook('displayHome'); } and: public function hookDisplayHome($params) { if (!isset($this->prepared) || !$this->prepared) $this->_prepareHook($params); $this->prepared = true; $this->smarty->assign(array('id_module' => $this->id)); return $this->display(__FILE__, 'blocknewsletter_home.tpl'); } For tests, I copied the default blocknewsletter.tpl template, saved it under the name blocknewsletter_home.tpl and kept in the same location as the default one, i.e. blocknewsletter\views\templates\hook The effect of adding _home to a .tpl file name ends with something like this: HTML is displayed, no PHP code is executed. using the old template name, without the _home ending - works fine: Renaming the .tpl file in the case of the default hook hookDisplayLeftColumn produces the same behavior. Can someone experienced suggest some solution? .Tpl filename changes require some extra action? 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