Notice: You are browsing the documentation for PrestaShop 8, which is currently in development.

You might want to read the documentation for the current version, PrestaShop 1.7.

Make PrestaShop 1.6 modules compatible with 1.7

Module front controllers

There are several changes to templating in your module front controllers.

Getting a proper template for a page

In order to display content properly in your ModuleFrontController files, you need to change the way you link to your template file in your initContent method:

- $this->setTemplate('views/templates/front/template.tpl');
+ $this->setTemplate('module:yourmodule/views/templates/front/template.tpl');

Basic structure of a module front page template

If you want your module to display an entire page with your own content, the basic structure of your .tpl file looks like this:

{extends file='page.tpl'}

{block name='page_header_container'}
Title of the page
{/block}

{block name='page_content'}
Content of the page
{/block}

[Template inheritance]({{ relref " /8/themes/reference/template-inheritance “}}) is powerful mechanism available from v1.7 of PrestaShop.

More information about front office and templating are available [here]({{ relref “/8/modules/creation/displaying-content-in-front-office/#embedding-a-template-in-the-theme” }}) and [here]({{ relref “/8/themes/” }}).