Magento - Catalog.xml 未使用正确的模板
新手开发 Magento 主题,我似乎无法弄清楚为什么 Magento 不使用我在catalog.xml 上的 setTemplate 操作中指定的路径。
我在 /app/design/frontend/default/mycustomtheme 中有自己的主题,并且我一直在从基础修补文件并进行更改。
我已将 /app/design/frontend/base/default/layout/catalog.xml 复制到 /app/design/frontend/default/mycustomtheme/layout/catalog.xml 中的自定义主题。我已将模板设置为特定的 phtml 文件...
<catalog_product_view translate="label">
<label>Catalog Product View (Any)</label>
<!-- Mage_Catalog -->
<reference name="root">
<action method="setTemplate"><template>page/2column.phtml</template></action>
</reference>
但它不起作用。有人能发现问题可能是什么吗?我已经禁用了所有缓存以及我所做的其他更改,我可以立即看到,但不是这个。
编辑:我应该注意,如果我更改catalog_product_view xml节点中的其他内容,我会看到这些更改得到反映。例如,如果我删除
那么我会看到引用在渲染中被删除html 文件。
编辑2:添加图像来解决问题...
您是否从商店后端设置/配置了主题?
是的,它实际上正在加载正确的页眉和页脚,并且样式正确。
您确定 /app/design/frontend/default/mycustomtheme/ 下有这样的模板吗template/page/ 目录?
是的,我可以确认该文件在那里
Noob developing a Magento theme and I can't seem to figure out why Magento is not using the path I specify in the setTemplate action on catalog.xml.
I've got my own theme in /app/design/frontend/default/mycustomtheme and I've been patching files over from the base and making changes.
I've copied over /app/design/frontend/base/default/layout/catalog.xml to my custom theme at /app/design/frontend/default/mycustomtheme/layout/catalog.xml. I've set the template to be a specific phtml file...
<catalog_product_view translate="label">
<label>Catalog Product View (Any)</label>
<!-- Mage_Catalog -->
<reference name="root">
<action method="setTemplate"><template>page/2column.phtml</template></action>
</reference>
Yet it's not working. Can someone spot what the problem might be? I've got all cache disabled and other changes I make I can see immediately, just not this one.
edit: I should note, if I change something else in the catalog_product_view xml node I see those changes are reflected. For instance if I remove <action method="addJs"><script>varien/product.js</script></action>
then I see the reference is removed in the rendered html file.
edit2: Adding images to address questions ...
did you setup-up / configured the theme from your store backend?
Yes, and it's actually loading the correct header and footer, and it's properly styled.
Are you sure you have such template under /app/design/frontend/default/mycustomtheme/template/page/ directory?
Yes, I can confirm the file is there
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的天啊。我正在测试的(也是唯一的)产品在“设计”部分下设置了特定的布局。所以我想这会覆盖我在catalog.xml中设置的任何内容
我想要 3我生命中的几个小时又回来了。
OMG. The (one and only) product I was testing on had a specific layout set under the "Design" section. So I guess that was overriding anything I had set in catalog.xml
I'd like to have the 3 hours of my life back.