Forums / Templates, Stylesheets, Page Layout / how do I change which css is called on a page?

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

Views: 1,051

Results 1 to 12 of 12
31 Aug 2011, 2:32 PM
#1
scottdb avatar

scottdb

New Zenner

Join Date:
Jul 2011
Posts:
95
Plugin Contributions:
0

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**

31 Aug 2011, 3:35 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

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

31 Aug 2011, 3:56 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.

31 Aug 2011, 8:10 PM
#4
scottdb avatar

scottdb

New Zenner

Join Date:
Jul 2011
Posts:
95
Plugin Contributions:
0

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**

31 Aug 2011, 9:43 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.

1 Sep 2011, 3:40 AM
#6
scottdb avatar

scottdb

New Zenner

Join Date:
Jul 2011
Posts:
95
Plugin Contributions:
0

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**

1 Sep 2011, 3:57 AM
#7
scottdb avatar

scottdb

New Zenner

Join Date:
Jul 2011
Posts:
95
Plugin Contributions:
0

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:P
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**

1 Sep 2011, 4:16 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

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.

1 Sep 2011, 6:08 AM
#9
scottdb avatar

scottdb

New Zenner

Join Date:
Jul 2011
Posts:
95
Plugin Contributions:
0

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**

1 Sep 2011, 6:10 AM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.

1 Sep 2011, 6:37 AM
#11
scottdb avatar

scottdb

New Zenner

Join Date:
Jul 2011
Posts:
95
Plugin Contributions:
0

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

Ok. I understand now but since I am creating this site for someone else and have no idea what they will do with it in the future I was thinking I might want to do that.

I noticed that like in the includes/languages/english/html_includes folder that if I don't put a custom folder in there and place the define_contact_us.php in it the info is shown on the page but does not get backed up. Do all the other places where there is a classic folder operate this way? Kind of thinking it does but just want to make sure. If so I think it would be a good idea since I have no way of telling what the person will do with the site once it is finished.

Best Regards,
Scott
**My test site**

1 Sep 2011, 7:55 AM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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

the info is shown on the page but does not get backed up?? Not sure what you mean by this... You should definitely put any file that you modify into the correct /your_template/ folder. If someone else will be maintaining the site in the future, it would be a very good idea to make a full set of /your_template/ folders mirroring the /classic/ folders, so they have a clear place to put any future modified files.