Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  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

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

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

    man that 7 min for editing needs to be extended to 12 or 15 for us newbies
    Just read the tutorial again and read the related articles in the bottom. I see now. I add the changes to the languages/english/header.php by adding my custom folder to the languages folder and placing the edited header.php there. I just need to place the changed files in there correct? Or do I need to copy the entire folder over to the custom folder and make the changes to the custom folder files?
    Best Regards,
    Scott
    My test site

  8. #8
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

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

    Just the files you change.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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

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

    Thanks, And wow, this site is getting easier to use and understand the more I try and make my own template.

    One last question about making my own template. I know I got off the original subject but was wondering if I should go through everywhere I see a clasic folder if I should be putting a custom folder with it so that in the future any edits will be saved.
    Best Regards,
    Scott
    My test site

  10. #10
    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?

    You don't have to have /custom/ folders everywhere there is a /classic/ folder, but it can't hurt and may make future work easier. Do not copy any files unless you are changing them, though, or you will make upgrading more complicated with unnecessary files to check.

 

 
Page 1 of 2 12 LastLast

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