dq62957 2013-08-22 16:28
浏览 30

在特定产品列表页面(目录)上添加CSS /代码Magento

I want to hide some things from certain product list (catalogue) pages - I know when using Wordpress you can use the page ID's etc but is there any way in Magento to target just certain product list pages?

Just to be clear, I am on about the page that lists all of the products from certain categories - not CMS pages.

In my head it makes sense that I can simply target by a URL?!? E.g. in the head if url = ...

Thought that is a complete guess.

The main aim is to hide the prices and buy buttons of products on all pages except from two categories - there might be an easier way to do it?

  • 写回答

2条回答 默认 最新

  • dphfwzn8269 2013-08-22 16:53
    关注

    You can do this within the category settings:
    Magento Admin -> Catalog -> Manage Categories -> Custom Design -> Custom Layout Update

    This section takes XML updates, and you can add CSS to your head via XML here, like so (choose one):

    //Simple way for CSS - Falls Back from Your Theme to Default/Base
    //Goes to your theme's skin folder first
    
    <reference name="head">
        <action method="addCss"><name>css/yourStylesheet.css</name></action>
    </reference>
    
    
    //Specific way for CSS, can also be used for JS
    //More lines, but you can change the type for different folders and javascript too
    
    <reference name="head">
        <action method="addItem">
            <type>skin_css</type>
            <name>css/yourStylesheet.css</name>
        </action>
    </reference>
    


    Save and refresh your cache. Make sure your stylesheets are in the right folders!


    addItem Types

    <type>skin_css</type> => Magento/skin/frontend/your_package/your_theme/ Folder

    <type>skin_js</type> => Same as above, specify folder js/yourScript.js for name.

    <type>js</type> => Looks in the root Magento Installation Folder. Used for the "\js\" and "\lib\" folders in the root directory of a magento install, commonly. I suppose you could tree it out to different folders if you'd like, since the base magento directory is the working directory with this type.

    评论

报告相同问题?

悬赏问题

  • ¥15 echarts动画效果失效的问题。官网下载的例子。
  • ¥60 许可证msc licensing软件报错显示已有相同版本软件,但是下一步显示无法读取日志目录。
  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加