Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2007
    Posts
    195
    Plugin Contributions
    2

    help question 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?

  2. #2
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default 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

  3. #3
    Join Date
    Nov 2007
    Posts
    195
    Plugin Contributions
    2

    Default 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?

  4. #4
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default 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

  5. #5
    Join Date
    Nov 2007
    Posts
    195
    Plugin Contributions
    2

    Default Re: CSS on specific pages, Javascript on all pages

    It's ok I found it, the rules are in the readme
    Code:
                 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

  6. #6
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: CSS on specific pages, Javascript on all pages

    Quote Originally Posted by banswidthjunkie View Post
    Now I just need to get the js issue sorted
    It's also in the readme's ... see your /docs/ folder.
    .

    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.

  7. #7
    Join Date
    Nov 2007
    Posts
    195
    Plugin Contributions
    2

    Default Re: CSS on specific pages, Javascript on all pages

    Thanks, that's great.

 

 

Similar Threads

  1. v151 Banners show in all pages, except for product pages. Help!
    By AquaticAddiction in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 6 Mar 2014, 05:56 PM
  2. Managing Javascript with EZ Pages
    By imperialized in forum General Questions
    Replies: 0
    Last Post: 4 Jan 2012, 10:01 PM
  3. Specific pages for specific customers
    By DamienDLSkinSolution in forum General Questions
    Replies: 3
    Last Post: 15 Mar 2010, 04:28 AM
  4. Default CSS Optmization - How do I change CSS File name in header of all pages?
    By Beama in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 7 Oct 2009, 09:50 PM
  5. Change CSS on specific page/pages
    By elchoco in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 1 Dec 2008, 03:23 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