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>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效