简体   繁体   English

Magento:“热门搜索词”页面上的右侧边栏

[英]Magento : Right Sidebar on Popular Search Term page

Configuration of <catalogsearch_term_popular> is set as not to display left and right sidebar. 的配置<catalogsearch_term_popular>被设定为不显示leftright侧栏。

 <catalogsearch_term_popular translate="label">
        <label>Popular Search Terms</label>
        <remove name="right"/>
        <remove name="left"/>

How to update local.xml so that I can bring back the removed right reference? 如何更新local.xml以便可以取回已删除的正确引用?

The way the xml is parsed means that all the remove statements bubble to the bottom. 解析xml的方式意味着所有remove语句冒泡到底部。 In some cases you can simply add the block back in with another name, but the same alias. 在某些情况下,您可以简单地将块添加回另一个名称,但使用相同的别名。

<block type="core/text_list" name="my_right" as="right" translate="label">
    <label>Right Column</label>
</block>

Unfortunately this only really works with leaf nodes, ie nodes that will never be used as references from other xml layout files. 不幸的是,这仅适用于叶节点,即永远不会用作其他xml布局文件引用的叶节点。 Since right and left are container nodes not leaf nodes this won't work. 由于左右是容器节点而不是叶节点,因此将无法使用。 I've never personally used the code, but I have previously come across a workaround by Alan Storm , which is probably worth a look. 我从来没有亲自使用过代码,但是我以前遇到过Alan Storm的变通方法 ,这可能值得一看。

The only other option is to create a copy of catalogsearch.xml in your theme, and take out the two removes from that layout handle. 唯一的选择是在您的主题中创建catalogsearch.xml的副本,并从该布局句柄中删除两个删除项。 This file will overload the original and not remove the nodes, but this is a poor option since any changes to the catalogsearch.xml file in future releases will not been seen when using your theme. 该文件将使原始节点过载,并且不会删除节点,但这是一个糟糕的选择,因为在使用主题时将看不到对将来版本中对catalogsearch.xml文件的任何更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM