Zen Cart Logo
Forums / General Questions / CSS on specific pages, Javascript on all pages

CSS on specific pages, Javascript on all pages

Locked

Views: 1,657

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
22 Dec 2007, 10:14 AM
#1
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

CSS on specific pages, Javascript on all pages

The title is basically the question.

Is there a way of including a javascript file in the header of every page, so for example a bit of javascript could be used in a side box.

Conversely, if there is a CSS stylesheet that is used on a few select pages, is there a way of including the stylesheet for just those pages?

22 Dec 2007, 4:35 PM
#2
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: CSS on specific pages, Javascript on all pages

Why not do a stylesheet for the category call it c_4.css
Where 4 would be the category for "shirts"

the stylesheet would consist of declarations used only by that category.

You could change the header_bg image and any thing else to make that page unique.

The stylesheet would only be called when that category page is displayed.

doing this saves messing with the core code.
From another thread..may help...tested..works..adapt to suit requirements

22 Dec 2007, 5:17 PM
#3
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

Re: CSS on specific pages, Javascript on all pages

Cheers, can you give me a link to the thread. And do you know what the rules are for a stylesheet being included when a given page loads?

22 Dec 2007, 5:23 PM
#4
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: CSS on specific pages, Javascript on all pages

Sorry, do not have actual link..just made a note of instructions..
If should find it, will post again here

22 Dec 2007, 5:26 PM
#5
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

Re: CSS on specific pages, Javascript on all pages

It's ok I found it, the rules are in the readme

             style*.css   // are always loaded and at least ONE should contain site-wide properties.
language_stylesheet.css   // changes to ALL pages, when that language is used
          page_name.css   // changes to one page 
 language_page_name.css   // changes to one page, when that language is used
            c_??_??.css   // changes to all info pages in a category
   language_c_??_??.css   // changes to all info pages in a category, when that language is used
               m_??.css   // changes to a manufacturer's listing page
      language_m_??.css   // changes to a manufacturer's listing page, when that language is used
               p_??.css   // changes to a product's info page
      language_p_??.css   // changes to a product's info page, when that language is used
             print*.css   // printer-friendly global usage site-wide changes for printing-only

Now I just need to get the js issue sorted

22 Dec 2007, 5:47 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: CSS on specific pages, Javascript on all pages

banswidthjunkie:

Now I just need to get the js issue sorted

It's also in the readme's ... see your /docs/ folder.

22 Dec 2007, 6:31 PM
#7
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

Re: CSS on specific pages, Javascript on all pages

Thanks, that's great.