【问题标题】:Magento top nevigation bar different colors for categoriesMagento 顶部导航栏不同颜色的类别
【发布时间】:2016-10-30 00:53:16
【问题描述】:

如何使顶部导航栏中的一个类别与其他类别的颜色不同? 对于instens- SALE类别

谢谢

【问题讨论】:

    标签: magento-1.9


    【解决方案1】:

    方法一,最简单的

    如果您在模板中默认获取类,则可以使用类别类 (echo $this->getBodyClasses())

    在这种情况下,您应该在包 css 中使用 .category-sales 选择器 .背景红色的示例:

    body.category-sales .links ul li {
     background:red;
    }
    

    方法二

    ...其他方式可能是通过布局添加 custom.css

    在这种情况下,您需要在 skin/frontend/yourpackage/yourtheme/css/category-sales.css 之外创建一个文件

    并且仅为特定类别 ID 添加此文件

      <CATEGORY_"your category id">
        <reference name="head">
           <action method="addItem">
              <type>skin_css</type>
              <name>css/category-sales.css</name>
           </action>
         </reference>
       </CATEGORY_"your category id">
    

    编辑这个布局更新应该在你的 local.xml

    【讨论】:

    • 感谢您的回答。第二种情况,category-sales.css文件应该放什么?
    • 您需要覆盖此类别的每个 css... 用于顶部链接中的简单背景... .links ul li { background: red; }
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-28
    • 1970-01-01
    • 2013-08-03
    • 1970-01-01
    • 1970-01-01
    • 2019-11-12
    相关资源
    最近更新 更多