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 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图