fabricianono Posted December 19, 2016 Share Posted December 19, 2016 Hello, I have created a module named gestionfournisseur. I need to modify some part of frontend view in this module. For this, I had created two file: 1 - gestionfournisseur/controllers/front/display.php: this file content my controller logic and herit ModuleFrontController <?php class gestionfournisseurdisplayModuleFrontController extends ModuleFrontController { public function initContent() { parent::initContent(); $this->setTemplate('display.tpl'); } } 2 - gestionfournisseur/views/templates/front/display.tpl: content the view I want to display. Hello World!! I generated the link to this page with the following instruction in my module main file: $this->name = 'gestionfournisseur'; $this->context->link->getModuleLink($this->name,'display') But, prestashop return me a big exception: No template found for display.tpl If it can't help you, the content of my variable $this->context->smarty->getTemplateDir() look like this: array:1 [▼ 0 => "/my_hosts/manishop/themes/classic/templates/" ] Please can't you tell me what is the problems? Link to comment Share on other sites More sharing options...
DD_DD2 Posted December 20, 2016 Share Posted December 20, 2016 Hi fabricianono In PS 1.7 you have to call the template like this: $this->setTemplate('module:gestionfournisseur/views/templates/front/display.tpl'); Hope it will be useful. Link to comment Share on other sites More sharing options...
fabricianono Posted December 21, 2016 Author Share Posted December 21, 2016 Ohhhh, It work fine. But I have new problem, my page don't have a default layout. Do you nknow why?? I want to use default layout. Link to comment Share on other sites More sharing options...
DD_DD2 Posted December 21, 2016 Share Posted December 21, 2016 great step forward ! Now you have to insert the code of your file display.tpl like below {extends file='page.tpl'} {block name='page_content'} ... your code ... {/block} 1 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