Prestashop 无法在同一模块模板中加载同一模块模板文件

Prestashop 无法在同一模块模板中加载同一模块模板文件,prestashop,prestashop-1.6,prestashop-1.7,Prestashop,Prestashop 1.6,Prestashop 1.7,我正在研究Prestashop模块。在这个模块中,我有一个冗长的html模板。所以,我把它分解成更小的子模板 现在,我有一个基本模板文件,其中包括我的所有子模板文件 我的模板目录如下所示: /modules/my_module/views/templates/front/base.tpl /modules/my_module/views/templates/front/upper_section.tpl /modules/my_module/views/templates/front/m

我正在研究Prestashop模块。在这个模块中,我有一个冗长的html模板。所以,我把它分解成更小的子模板

现在,我有一个基本模板文件,其中包括我的所有子模板文件

我的模板目录如下所示:

/modules/my_module/views/templates/front/base.tpl  
/modules/my_module/views/templates/front/upper_section.tpl  
/modules/my_module/views/templates/front/middle_section.tpl  
/modules/my_module/views/templates/front/bottom_section.tpl  
现在,我将上述所有模板文件都包含在base.tpl中,如下代码所示:

{include file='upper_section.tpl'}  
{include file='middle_section.tpl'}  
{include file='bottom_section.tpl'}  
当我运行模块的fron控制器时,prestashop给我的错误是“无法加载模板upper_section.tpl”

我也尝试过为模板文件提供相对路径和绝对路径,但每次都会出现相同的错误


有人能帮我解决这个问题吗?

将您的包含更改为包含当前文件夹中的文件

{include file='./upper_section.tpl'}  
{include file='./middle_section.tpl'}  
{include file='./bottom_section.tpl'}
给你另一条路

{include file='module:my_module/views/upper_section.tpl'}