首页 文章

Prestashop 1.7中的定制挂钩

提问于
浏览
1

我尝试为滑块模块创建一个自定义Hook for Prestashop 1.7.0.3 . 我插入:

displaySlider: - ps_imageslider

在块“钩子”上的theme.yml文件上 . 然后插入:

{if $page.page_name == 'index'} 
   {hook h='displaySlider'}
{/if}

在 Headers 和section id =“wrapper”标记之间的theme / templates / layouts / layout-both-columns.tpl文件中 . 根据这篇文章:Custom Hooks in Prestashop 1.7当我尝试从后端更改滑块模块位置时,一切都会正常工作,但钩子没有显示在可用的钩子上 .

1 回答

  • 4

    我今天在同一个问题上工作 .

    我成功地让它出现,它可能不是好方法,我希望它不是好方法,因为它很奇怪 .

    在你的theme.yml中,你必须像这样设置你的钩子:

    global_settings:
      hooks:
        custom_hooks:
          - name: displayFooterBefore
            title: displayFooterBefore
            description: Add a widget area above the footer
    

    如果你想在位置页面看到你的钩子,你必须切换到另一个模板然后回到你的模板 . (刷新的种类)

    您还可以查看Prestashop的不完整文档:http://developers.prestashop.com/themes/hooks/index.html

    我希望在这个页面中有另一种刷新钩子的方法......

相关问题