【发布时间】:2016-04-05 11:30:20
【问题描述】:
您好,我正在构建一个模块,我需要在其中覆盖我的模块文件中的 gallery.phtml 文件。
为此,我在我们的模块布局文件夹中创建了一个catalog_product_view.xml,其中包含以下内容
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product.info.media.image" remove="true"/>
<referenceContainer name="product.info.media">
<block class="Magento\Catalog\Block\Product\View\Gallery" name="product.info.media.image" template="product/view/gallery.phtml"/>
</referenceContainer>
</body>
</page>
但它没有从这里渲染文件。当我设置
<referenceBlock name="product.info.media.image" remove="true"/> 为 false 它开始渲染基础图像。
请指出我做错了什么。
【问题讨论】:
标签: xml magento templates overriding magento2