Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    Jul 2011
    Posts
    93
    Plugin Contributions
    0

    Default how do I change which css is called on a page?

    Hi, I know I have seen this before but I cant find it in a search now.

    I have edited the classic stylesheet.css to make my home page look like I want. I am going to rename it and have it used for just the main page. Where do I edit the home page to change which stylesheet it uses?
    Best Regards,
    Scott
    My test site

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: how do I change which css is called on a page

    Before you continue...

    You should not be using the CLASSIC template as your site main template. You should create a CUSTOM template, and make your edits there. The CLASSIC template is an important diagnostic tool and should not be edited.
    20 years a Zencart User

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: how do I change which css is called on a page

    Once you have duplicated your /classic/ template into /custom/ template folders and activated the template per the tutorial, you can put a supplemental home page stylesheet named index_home.css into /includes/templates/your_template/css/.
    The base stylesheet will always be used; index_home.css should only contain the rules that are different from the base stylesheet, and these will override the base styles where necessary.

  4. #4
    Join Date
    Jul 2011
    Posts
    93
    Plugin Contributions
    0

    Default Re: how do I change which css is called on a page

    Thanks for the responses. I have read the tutorials but was wondering if I need to put somewhere what css page is called up? In other sites that I have edited before the head is always a list of what stylesheets are being used to call up the info. Do I have to do this with this script or by calling it index_home.css does it automatically use that for the index page?

    I created a test site to make all my edits and changed them in the classic template. That was before I read the tutorials. I have created another test site and putting everything in my own custom folder now. One thing I was wondering though is about all the edits I make to files that are in other folders such as the header.php and stuff. If in the future I upgrade will these be affected? Do I need to put these changes in the custom folder as well? The sites that I have worked with in the past were very basic and this is a lot more complex than what I am used to working with.
    Best Regards,
    Scott
    My test site

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: how do I change which css is called on a page

    Any file that you have edited needs to be saved in a /your_template/ folder (with a few exceptions where template overrides are not possible).

    Zen Cart does all the stylesheet management using various criteria. Simply naming a file index_home.css and saving it in your template's /css/ folder will cause it to be called in the head for your home page, after the base stylesheet.css.

  6. #6
    Join Date
    Jul 2011
    Posts
    93
    Plugin Contributions
    0

    Default Re: how do I change which css is called on a page?

    Thanks for clearing that up for me. That is the way I thought I had read about the adding of the css but wanted to make sure. Very different from what I was am to.

    When I first started editing this script for someone else I thought this script has been made harder and more limited to what you can do than I have ever seen. The more I work with it I see that it is actually built to be very easy. Just got to get used to it. Learning a lot about css using this script.

    One more question about putting the edited files into the custom template folder though. So say for the header.php file. When I place it into the custom folder I should probably make a folder called English and place it in it so that I am keeping the same folder structure?
    Best Regards,
    Scott
    My test site

 

 

Similar Threads

  1. how to change css for one ez-page?
    By blrw in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 9 Mar 2012, 12:10 PM
  2. Replies: 5
    Last Post: 11 Sep 2010, 01:55 PM
  3. Login page - how is it called?
    By split63 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Jun 2010, 06:17 AM
  4. after add to cart is pressed, which file is being called?
    By bangsters in forum General Questions
    Replies: 4
    Last Post: 15 Dec 2009, 04:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg