medoampir Posted May 30, 2018 Share Posted May 30, 2018 (edited) I'm trying to follow the official guide of prestashop but I am facing 2 issues: I see the display.tpl as raw text and not embedded in the main theme. I can't see the message stored in the variable "my_module_message" mymodule.php public function hookDisplayLeftColumn($param) { $this->context->smarty->assign( array( 'my_module_name' => configuration::get('G2A_NAME'), 'my_module_link' => $this->context->link->getModuleLink('g2a','display'), 'my_module_message' => $this->l('This is a simple text message'))); return $this->display(__FILE__ , 'g2a.tpl'); } controllers/front/display.php class g2adisplayModuleFrontController extends ModuleFrontController { public function initContent() { parent::initContent(); $this->context->smarty->assign('my_module_message', $this->l('This is a simple text message')); $this->setTemplate('module:g2a/views/templates/front/display.tpl'); } } views/templates/front/display.tpl {extends file=$layout} {block name='content'} welcome to my shop! {$my_module_message} {/block} Edited May 30, 2018 by medoampir code update (see edit history) Link to comment Share on other sites More sharing options...
jgamio Posted May 30, 2018 Share Posted May 30, 2018 HI 1 you are on 1.7 you need extend the structure of the tpl for example {extends file='page.tpl'} 2 because you are not send any information you need set the smarty on the frontcontroller Link to comment Share on other sites More sharing options...
medoampir Posted May 30, 2018 Author Share Posted May 30, 2018 15 hours ago, jgamio said: HI 1 you are on 1.7 you need extend the structure of the tpl for example {extends file='page.tpl'} 2 because you are not send any information you need set the smarty on the frontcontroller none of these solutions worked for me. i'm not sure why. 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