Jump to content

How to include modules directly into template files?


Recommended Posts

Hi there, how do I go about including module files within my own theme? I don't want to use hooks, as the layout of modules inside those hooks seems very rigid and sloppy CSS code is the only way to move divs around.

 

For example, I'd like to include blocktopmenu in header.tpl. I have tried 

{include file="$tpl_dir./modules/blocktopmenu/blocktopmenu.tpl"}

Which returns the following error:

 

 

 

Notice: Undefined index: MENU in /home/s7media/public_html/test/loveyourspecialday/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 28

Notice: Trying to get property of non-object in /home/s7media/public_html/test/loveyourspecialday/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 28

 

I've tried a few different variations yielding no results.

 

How can I go about this please?

 

Thanks

Link to comment
Share on other sites

I am not sure why you prefer not to use hooks but anyway you cannot load module by calling the template file, you are missing all the server side processing of the module.

My only suggestion for you is to create a new hook for the desire module, position the module in that hook and than call the hook in your header.tpl.

like: {hook h='new_hook_name' mod='name_of_module'}

 

check this tutorial if you are not sure about how to create new hook, http://doc.prestashop.com/display/PS16/Managing+Hooks

Link to comment
Share on other sites

  • 3 weeks 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...