BarryKirk Posted December 18, 2014 Share Posted December 18, 2014 Hi, Can you please help? I have installed and configured prestashop on my PC and on my host domain and it looks great. I have gone thru the process to create my own module "My Module". It nearly works, but when I click the #Click Me" link on my page I get an errro file not found.Link is: http://www.badgeras.com/Inspirasjon/index.php?fc=module&module=mymodule&controller=display&live_configurator_token=a8fbc74c943cbce2fc1ebec0dc9bcb16&id_shop=1&id_employee=1&theme=&theme_font= /modules/mymodule/templates/display.tpl content is: Welcome to my shop! /modules/mymodule/templates/mymodule.tpl content is: <!-- Block mymodule --><div id="mymodule_block_home" class="block"> <h4>Welcome!</h4> <div class="block_content"> <p>Hello, {if isset($my_module_name) && $my_module_name} {$my_module_name} {$my_module_message} {else} World {/if} ! </p> <ul> <li><a href="{$my_module_link}" title="Click this link">Click me!</a></li> </ul> </div></div><!-- /Block mymodule --> /modules/mymodule/controllers/front/display.php content is: <?phpclass mymoduledisplayModuleFrontController extends ModuleFrontController{ public function initContent() { parent::initContent(); $this->setTemplate('display.tpl'); }}?> Link to comment Share on other sites More sharing options...
bellini13 Posted December 18, 2014 Share Posted December 18, 2014 It is not clear where you define the variable $my_module_link <li><a href="{$my_module_link}" title="Click this link">Click me!</a></li> You have not shown the code that creates this link, what value you are receiving, and what value you are getting. Link to comment Share on other sites More sharing options...
BarryKirk Posted December 18, 2014 Author Share Posted December 18, 2014 Hi I used the documentation from the prestashop 1.6 developers guide Here is the extract from the mymodule.php. public function hookDisplayLeftColumn($params){ $this->context->smarty->assign( array( 'my_module_name' => Configuration::get('MYMODULE_NAME'), 'my_module_link' => $this->context->link->getModuleLink('mymodule', 'display'), 'my_module_message' => $this->l('This is a simple text message') ) ); return $this->display(__FILE__, 'mymodule.tpl');} Any ideas? Link to comment Share on other sites More sharing options...
bellini13 Posted December 18, 2014 Share Posted December 18, 2014 and what is the value of the link that you get? Link to comment Share on other sites More sharing options...
BarryKirk Posted December 19, 2014 Author Share Posted December 19, 2014 Hi, The value of the generated link is:http://www.badgeras.com/Inspirasjon/index.php?fc=module&module=mymodule&controller=display Link to comment Share on other sites More sharing options...
BarryKirk Posted December 19, 2014 Author Share Posted December 19, 2014 This can be seen at my site www.badgeras.com/Inspirasjon Link to comment Share on other sites More sharing options...
bellini13 Posted December 19, 2014 Share Posted December 19, 2014 I don't get a 404 page not found or file not found error, I get a 500 server error when I click on the "click me" link. Link to comment Share on other sites More sharing options...
jfpwork Posted September 18, 2015 Share Posted September 18, 2015 (edited) It's late but could help here the tree (under 1.6.1.1): -mymodule |- controllers |-- front |--- display.php |- css |-- mymodule.css |- views |-- templates |--- front |---- display.tpl |--- hook |---- mymodule.tpl |- mymodule.php Edited September 18, 2015 by jfpwork (see edit history) 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