【问题标题】:Removing the block "Popular Tags" from the index view in Magento从 Magento 的索引视图中删除块“流行标签”
【发布时间】:2011-02-08 22:00:34
【问题描述】:

本周我开始使用 Magento,我正在尝试创建一个新主题。在 wiki 的 "Designing for Magento" 文章之后,我尝试从索引视图中删除热门标签块,将此行添加到 magento\app\design\frontend\default\mytheme\layout 上的 local.xml:

<remove name="tags_popular"/>

我不知道为什么,但是标签仍然存在,而如果我执行以下操作,语言切换器就会消失:

<remove name="store_language"/>

我也试过这个没有效果:

<reference name="left">
    <action method="unsetChild"><name>tags_popular</name></action>
</reference>

我什至删除了 tag.xml 并且标签仍然存在!

我知道我可以摆脱他们在后端禁用 Mage_tag,购买我想了解为什么这不起作用。

谢谢!

【问题讨论】:

  • 您是否尝试禁用缓存。如果缓存已打开(这是默认选项),您可能看不到您对模板所做的更改。

标签: magento layout


【解决方案1】:

只需将其添加到您的 theme->page.xml 默认块中

<remove name="tags_popular"/>

您可以移除任何磁电机的方块。然后你可以在它的块名称之后删除。 在这里你看到 tag_popular 它的块名称删除加上它的块名称 Remove default magento block

【讨论】:

    【解决方案2】:

    查看 tag.xml,您会在其中找到此代码,您必须将其注释掉:

    <default>
        <!-- Mage_Tag -->
        <reference name="left">
            <block type="tag/popular" name="tags_popular" template="tag/popular.phtm">
                <action method="setTemplate"><template>tag/popular.phtml</template></action>
            </block>
        </reference>
    </default>
    

    【讨论】:

      【解决方案3】:

      多么愚蠢,流行的标签显示在主页中,因为它们出现在内容页面的默认代码中(菜单:CMS > Pages),所以我只需要删除它:P

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-06-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-12-04
        • 2023-03-18
        • 2019-10-11
        相关资源
        最近更新 更多