投票和比较块需要在magento中取出
我在/checkout/cart页面中遇到了一些问题,需要删除两个块: -比较产品块 -投票区 我无法从右侧栏中删除它们 当前布局的xml 只有我的一个模板添加到右侧DAR投票和比较块需要在magento中取出,magento,sidebar,Magento,Sidebar,我在/checkout/cart页面中遇到了一些问题,需要删除两个块: -比较产品块 -投票区 我无法从右侧栏中删除它们 当前布局的xml 只有我的一个模板添加到右侧DAR <reference name="right"> my adding template code here </reference> 我在这里添加模板代码 此外,我刚刚删除了所有添加到右侧边栏的模板 /layout/page.xml 结果,我在右栏看到了这两个块(比较和投票)( 让我知道我可以
<reference name="right">
my adding template code here
</reference>
我在这里添加模板代码
此外,我刚刚删除了所有添加到右侧边栏的模板
/layout/page.xml
结果,我在右栏看到了这两个块(比较和投票)(
让我知道我可以从哪里移除它们
谢谢(我发现问题出在哪里了) Magento布局包括以下内容之一 /layout/poll.xml 在那里我看到了这些线条
poll/active.phtmlpoll
poll/result.phtmlresults
评论之后,它们消失了)我希望您正在使用
local.xml
进行自定义
在local.xml中
<default>
<!--other codes-->
<remove name="catalog.compare.sidebar" />
<remove name="right.poll" />
<!--other codes-->
</default>
如果只需要从收银台页面中删除并保留在其他页面上,则使用
处理程序而不是“unSetChild”。
请记住
将完全删除该块。使用local.xml几乎可以实现任何功能,这显示了magento的强大功能。这是最好和首选的方法,因此始终避免更改其他XML文件。因为,magento在每个页面呈现中创建一个临时的全局XML,从而覆盖local XML.Pascal中提到的函数,是的,这是可行的,但是上面的答案是实现这一点的正确方法。如果要升级Magento,这些更改将丢失。
<!-- Mage_Poll -->
<reference name="right">
<block type="poll/activePoll" name="right.poll">
<action method="setPollTemplate"><template>poll/active.phtml</template><type>poll</type></action>
<action method="setPollTemplate"><template>poll/result.phtml</template><type>results</type></action>
</block>
</reference>
</default>
<default>
<!--other codes-->
<remove name="catalog.compare.sidebar" />
<remove name="right.poll" />
<!--other codes-->
</default>