【问题标题】:Magento: <action method="unsetChild"> Not removing a blockMagento:<action method="unsetChild"> 不删除块
【发布时间】:2012-09-07 12:11:17
【问题描述】:

我使用以下代码将Wishlist_Sidebar 的显示从右向左切换,但侧边栏仍保留在左右侧边栏中。

<reference name="right">                
    <action method="unsetChild"><name>wishlist_sidebar</name></action>
    //.....
</reference>
<reference name="left">
     <action method="insert"><blockName>wishlist_sidebar</blockName></action>
</reference>

如何解决这个问题

【问题讨论】:

    标签: magento block magento-1.7


    【解决方案1】:

    我认为 unsetChild 函数可能使用别名(as 属性而不是 name 属性。尝试使用...

    <reference name="right">                
        <action method="unsetChild"><name>wishlist</name></action>
        //.....
    </reference>
    

    【讨论】:

    • ?!?如果在没有 as="" 的情况下添加了块,那么您应该怎么做呢? .. Magento .. 废话.. 没有 as :D
    • 我没有测试过但是AFAIK,如果没有as属性,那么name就足够了。
    • 正确,如果as 不存在,则使用name 代替。
    猜你喜欢
    • 1970-01-01
    • 2013-12-25
    • 2015-03-27
    • 2017-03-24
    • 2016-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-31
    相关资源
    最近更新 更多