【问题标题】:Need to override custom module a phtml file and a Magento theme template file需要覆盖自定义模块一个 phtml 文件和一个 Magento 主题模板文件
【发布时间】:2016-11-30 05:39:50
【问题描述】:

我在 Magento2 中使用默认的 Magento Luma 主题。我想更改这个文件,需要覆盖app/code文件夹中的/vendor/magento/module-theme/view/frontend/templates/html/header.phtml文件。

我还想更改现有的自定义模块模板文件以覆盖:

app/code/company/modulename/view/frontend/templates/view.phtml

我尝试了很多方法,但它们都不起作用。

【问题讨论】:

    标签: magento2


    【解决方案1】:

    请按照以下说明进行操作:

    1.>> 您想要覆盖任何供应商/扩展/模块 .PHTML 文件。您需要创建自己的主题。之后,您将覆盖 .PHTML 文件。

    2.>>点击这里了解如何创建主题https://www.cloudways.com/blog/create-custom-theme-magento-2-part-1/

    3.>> app/design/frontend/自定义包名/自定义主题名/Magento_Theme/templates/html/header.phtml

    【讨论】:

      猜你喜欢
      • 2012-11-11
      • 2012-07-14
      • 1970-01-01
      • 2014-08-10
      • 2012-07-06
      • 1970-01-01
      • 2017-04-15
      • 2012-05-30
      • 1970-01-01
      相关资源
      最近更新 更多