我知道有人问过这个问题,但我一直找不到适合我的答案。我有一个我构建的自定义模块,它在提供搜索结果时也会搜索 CMS 静态页面。在这个模块中,我有一个更新布局 xml 的文件。我确定我的 xml 正在加载。出于某种原因,我尝试删除或取消设置分层导航并将其移动到右列都没有结果。以下是我的代码,我希望有人能帮助指出我的错误。谢谢!
<layout version = "0.1.0">
<catalog_category_default>
<reference name="left">
<action method="unsetChild"><name>catalog.leftnav</name></action>
</reference>
<reference name="right">
<action method="insert"><child>catalog.leftnav</child></action>
</reference>
</catalog_category_default>
<catalogsearch_result_index>
<reference name="content">
<block type="cmssearch/results" name="cms-search-results-view" after="search.result" template="cmssearch/cmssearchview.phtml">
</block>
</reference>
<reference name="left">
<!-- <remove name = "catalogsearch.leftnav" /> -->
<action method="unsetChild"><name>catalogsearch.leftnav</name></action>
</reference>
<reference name="right">
<!-- <block type="catalogsearch/layer" name="catalogsearch.leftnav" before="+" template="catalog/layer/view.phtml"/> -->
<action method="insert"><child>catalogsearch.leftnav</child></action>
</reference>
</catalogsearch_result_index>
<catalog_category_layered>
<reference name="left">
<action method="unsetChild"><name>catalog.leftnav</name></action>
</reference>
<reference name="right">
<action method="insert"><child>catalog.leftnav</child></action>
</reference>
</catalog_category_layered>