【问题标题】:Edit template layout in Magento在 Magento 中编辑模板布局
【发布时间】:2012-11-20 14:10:21
【问题描述】:

我正在尝试编辑基于 Magento 的网站主页的右侧边栏。当我在主页的Custom design 部分编辑Layout Update XML 字段时,我看到了这段代码:

<reference name="right">
  <action method="unsetChild"><name>catalog.compare.sidebar</name></action>
  <action method="unsetChild"><name>right.newsletter</name></action>
  <action method="unsetChild"><name>cart_sidebar</name></action>
  <block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page"/>
</reference>

但我找不到块标记中指定的布局在哪里。当我删除整个代码时,侧边栏仍在显示,但比较侧边栏 Widet 位于侧边栏的其余部分之上。

我是 Magento 的新手,有点迷茫。感谢您的帮助。

【问题讨论】:

  • 你到底想达到什么目的?
  • 我需要更改构成侧边栏的静态块。我可以单独编辑静态块,但我需要完全删除侧边栏的一些块。
  • &lt;reference name="right"/&gt; 中使用&lt;remove name="block_name"/&gt; 节点。

标签: magento


【解决方案1】:

使用这个

<remove name="catalog.compare.sidebar"/>

default

喜欢这个

<default>
  <reference name="right">
      <remove name="catalog.compare.sidebar"/>
   </reference>

</default>

会有用的

【讨论】:

  • 请检查比较侧栏是否存在于 catalog.xml 和 page.xml 中。请在此处也使用
【解决方案2】:

完成的最佳方法是在主题布局部分下创建 local.xml 文件并粘贴此代码。所以你不需要搜索所有的文件。

<layout version="0.1.0">
    <default>
        <!-- remove compare sidebar -->
        <remove name="catalog.compare.sidebar"/>
    </default>
</layout>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-12
    • 1970-01-01
    • 2012-11-18
    • 2015-11-27
    • 1970-01-01
    相关资源
    最近更新 更多