Message-ID: <223737789.375790.1710836574819.JavaMail.root@confluence-doc2-production> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_375789_1364660090.1710836574814" ------=_Part_375789_1364660090.1710836574814 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Views within PrestaShop

Views within PrestaShop

Views w= ithin PrestaShop

PrestaShop uses the Smarty template engine to generate its views: http:= //www.smarty.net/.

Theme views

The views are stored in .tpl files, and are used throughout= PrestaShop:

Module views

Modules can add their own templates to adapt parts of the interface:

There's a third template folder, called /hook/, which can be used for vi= ew files that are tied to a specific hook. For instance,

Best practices

A view name is generally the same as the name for the code using it. For= instance, 404.php uses 404.tpl.

Overriding a view file=

Keep overrides for your own shop

Overrides in PrestaShop are exclusive. This means that if your module ov= errides one of PrestaShop's behaviors, another module will not be able to u= se that behavior properly, or override it in an predictable way.

Therefore, overrides should only be used for your own local modu= les, when you have a specific need that cannot be applied with it.=

It is not recommended to use an override in a module that you in= tend to distribute (for instance through the PrestaShop Addons mar= ketplace), and they are forbidden in partner modules.

As there is no inheritance, there is no way to override a view. In order= to change a view, you must rewrite the template file, and place it in your= theme/module's folder, in the same path.

For views tied to a Helper, you can use the PrestaShop /override/<= /code> folder.
For instance, if you want to change the way the front of= fice order template file: /admin-dev/themes/default/template/controll= ers/orders/helpers/view/view.tpl
...you must copy the template fi= le and its path to the override folder: /override= /controllers/admin/templates/orders/helpers/view/view.tpl
...then= edit the copied template file to better suit your needs.

When adding an override file manually, do not forget= to delete the /cache/class_index.php file so that Presta= Shop can take your changes into account.

See the Overriding default behaviors page for more information.
<= /span>

 

------=_Part_375789_1364660090.1710836574814--