【问题标题】:Magento remove SEO-terms and advanced search from footer linksMagento 从页脚链接中删除 SEO 术语和高级搜索
【发布时间】:2012-09-13 00:07:56
【问题描述】:

我在互联网上看到了很多解决方案,但考虑到 Magento 的向上兼容性,它们似乎都不完整。

我想从 footer_links 参考中删除“热门搜索词”和“高级搜索”链接。

因为我希望我的站点准备好升级,所以我想通过 local.xml 来做到这一点,而不是通过将 catalogsearch.xml 复制到本地版本,因为我认为这不是向上兼容的。 我已经看到相关 .phtml 文件的一些更改,但我也认为这不是解决此问题的正确方法,应该可以通过 local.xml 对吧?

catalogsearch.xml 中的块中没有“名称”属性,如下所示:

    <reference name="footer_links">
        <action method="addLink" translate="label title" module="catalogsearch" ifconfig="catalog/seo/search_terms">
            <label>Search Terms</label>
            <url helper="catalogsearch/getSearchTermUrl" />
            <title>Search Terms</title>
        </action>
        <action method="addLink" translate="label title" module="catalogsearch">
            <label>Advanced Search</label>
            <url helper="catalogsearch/getAdvancedSearchUrl" />
            <title>Advanced Search</title>
        </action>
    </reference>

我应该如何解决这个问题?

编辑:页脚中的“站点地图”链接同样重要。

【问题讨论】:

    标签: magento magento-1.7


    【解决方案1】:

    您好,将此代码放在您的主题 local.xml 文件中,不要忘记删除缓存。这是在 CE 1.7.0.2 中测试的

    <?xml version="1.0"?>
    <layout version="0.1.0">
        <default>
            <reference name="footer_links">
                <!-- Remove 'Site Map' -->
                <action method="removeLinkByUrl"><url helper="catalog/map/getCategoryUrl" /></action>
                 <!-- Remove 'Search Terms' Link -->
                <action method="removeLinkByUrl"><url helper="catalogsearch/getSearchTermUrl" /></action>
                 <!-- Remove 'Advanced Search' -->
                <action method="removeLinkByUrl"><url helper="catalogsearch/getAdvancedSearchUrl" /></action>
        </reference>
     </default>
    </layout>
    

    【讨论】:

      【解决方案2】:

      在布局文件夹内的所有xml文件中搜索:

      app/design/frontend/THEME/NAME/layout/*.xml

      您将看到有多个文件使用 XML 添加链接到页脚链接块。 您可以根据需要简单地注释掉 addLink 标记

      <!--
      <action method="addLink" translate="label" module="tag">
              <name>tags</name><path>tag/customer/</path><label>My Tags</label>
      </action>
      -->
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-06-13
        • 1970-01-01
        • 2014-02-15
        • 1970-01-01
        • 2014-10-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多