Jump to content

Newbie question - Installed My Module , but CLick Me link fails


Recommended Posts

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:

<?php
class mymoduledisplayModuleFrontController extends ModuleFrontController
{
  public function initContent()
  {
    parent::initContent();
    $this->setTemplate('display.tpl');
  }
}
?>

 

 

 

Link to comment
Share on other sites

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

  • 8 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...