Jump to content

How to include .tpl file in a .tpl file. prestashop 1.7.7


S.A

Recommended Posts

4 hours ago, Razi said:

Hello,
in this case you can use this method for include any other file in current tpl
Example:
{include file='catalog/_partials/products-top.tpl' listing=$listing}

Thank you for your reply

structure of my project:

-mymodule

     -view

           -templates

                 -hook

                       - a.tpl

when I call file must become like this ?

{include file='templates/hook/a.tpl' listing=$listing} , Also what mean of this (listing=$listing)

Thank you

Link to comment
Share on other sites

in this example listing is the variable which you can use in your second tpl file.

and for include file you must need to use ../ for one step back in folder

{include file=".../../templates/hook/a.tpl"}

Link to comment
Share on other sites

8 minutes ago, Razi said:

in this example listing is the variable which you can use in your second tpl file.

and for include file you must need to use ../ for one step back in folder

{include file=".../../templates/hook/a.tpl"}

Does not work.. 

Error:

Unfortunately, there is no payment method available.

Link to comment
Share on other sites

  • 9 months later...

Hello,

Came across the same issue, the solution I've found was include "module:" before the address. (In case you are dealing with a module, if not there should be another method like this one).

Here's my example: 

 {include file='module:mymodule/views/templates/front/upperfooter.tpl'}

Regards, 

  • Like 1
Link to comment
Share on other sites

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...