Forums / Templates, Stylesheets, Page Layout / Trying to override the stylesheet on the index page only.

Trying to override the stylesheet on the index page only.

Locked

Started by bigjoed on 14 Apr 2008, 9:24 PM · Views: 2,044

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
14 Apr 2008, 9:24 PM
#1
bigjoed avatar

bigjoed

Zen Follower

Join Date:
Apr 2006
Location:
Fort Bragg, North Carolina
Posts:
152
Plugin Contributions:
0

Trying to override the stylesheet on the index page only.

I trying to change the background of my website but only for the index page. I understand that in order to do so, all I need is a css file on my template folder using the page name. Therefore I added an index.css to my css folder but it doesn't work.

Is there something I'm missing? If I change that file's name to anything other than index.css i.e. contact_us, login etc.. works perfectly.

Anybody has any idea what the issue is?

Thanks

14 Apr 2008, 10:27 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Trying to override the stylesheet on the index page only.

If you mean the home page, the name to use is index_home.css.

There are some confusing double meanings and duplicate words for the same meaning built into the ZC structure - legacy code in action.

14 Apr 2008, 10:45 PM
#3
bigjoed avatar

bigjoed

Zen Follower

Join Date:
Apr 2006
Location:
Fort Bragg, North Carolina
Posts:
152
Plugin Contributions:
0

Re: Trying to override the stylesheet on the index page only.

That did it.

THANKS

2 Feb 2009, 12:34 PM
#4
bigjoed avatar

bigjoed

Zen Follower

Join Date:
Apr 2006
Location:
Fort Bragg, North Carolina
Posts:
152
Plugin Contributions:
0

Re: Trying to override the stylesheet on the index page only.

Is there a way to modify the tpl_main_page.php only when viewing the home page? I don't want to modify the original too much with codes i.e. if this is home_page etc...

I'm wondering if I can do this with a folder inside templates/MY_TEMPLATE/ named differently. I have tried placing a copy of the tpl_main_page.php inside a folder called. home, home_page, index_home but had no luck.

Thanks for any help

16 Mar 2009, 11:34 AM
#5
googlepasta avatar

googlepasta

New Zenner

Join Date:
Sep 2007
Posts:
20
Plugin Contributions:
0

Re: Trying to override the stylesheet on the index page only.

Hmmm. I've put this in place because IE was ignoring inline CSS within define_main_page but it is being overridden by the Category style sheets. How can I stop the Category style sheets affecting the div on the main page's header?

16 Mar 2009, 12:10 PM
#6
googlepasta avatar

googlepasta

New Zenner

Join Date:
Sep 2007
Posts:
20
Plugin Contributions:
0

Re: Trying to override the stylesheet on the index page only.

OK so I've solved the problem with a horrible, horrible hacky work around but its working so what the hell. Besically I created a c_9.css which will always be the last to be read by pages like the home page. I don't have a category 9 so this works fine. I feel dirty but it got the job done.

16 Mar 2009, 1:33 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Trying to override the stylesheet on the index page only.

That's really odd, because c_9.css will never be loaded by the home page (unless you have set it to open with category 9); neither will any other category-specific stylesheet. You may have something messed up with your code if that is really what is happening.
Do a view source on the homepage and see what stylesheets are being called.