douzi1350 2012-09-17 13:47
浏览 25
已采纳

如何通过xml从分层导航中排除类别?

I found a suggestion how to do this in xml but as it does not work and I can only find ways to do it by changing core/local code, I'm posting here to see if anyone can shed some light on it.

this is the suggestion I found:

<reference name="catalog.leftnav">
    <action method="unsetChild"><alias>category_filter</alias></action>
</reference>

I added this to the catalog_category_default and _layered handles but with no result. On checking the core code it seemed the correct name for the alias should be layer_filter_category and so I changed to that on both handles but that didn't work either.

More as a desperation I also tried nesting reference in another reference to make sure it was loaded but I'm really unsure if this is correct at all?

<reference name="left">
    <reference name="catalog.leftnav">
        <action method="unsetChild"><alias>layer_filter_category</alias></action>
    </reference>
</reference>

It would be much appreciated if anyone could let me know the correct way to do this by xml.

Thanks a bunch in advance!

  • 写回答

1条回答 默认 最新

  • dongmin4052 2012-09-17 13:56
    关注

    If you want to do it via XML you should edit catalog.xml

    replace:

    <block type="catalog/layer_view" name="catalog.leftnav" 
        after="currency" template="catalog/layer/view.phtml" />  
    

    with this:

    <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml">  
        <action method="unsetChild"><alias>category_filter</alias></action>
    </block>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题