Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2008
    Posts
    2
    Plugin Contributions
    0

    help question vary center column background by page

    I'm trying to change the background color of the center column. I'd like it to be different for the index page and the product pages. In experimenting on my own, it seems that what I need to do is assign a class to the "<td>" containing the center column content. The problem is making it dynamic, so that the index page is different from the product pages. The line I'm trying to edit in "tpl_main_page.php" is:
    <td class="center<?php echo ($xxxx); ?>" valign="top">
    Hopefully, the class will then read something like: "centerindex" or "centercategory".

    I have tried various definitions for the "$xxxx" above. My thought is that I need whichever variable tells the system which file to put in the center column, but being a newcomer to both php and zencart, I can't figure out which variable that is. I don't need any specific name, I just need to vary between the index and product pages and be something consistent which I can style.

    I'd be very appreciative of any ideas or of any better ways to go about this.
    -Jessica

  2. #2
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: vary center column background by page

    Quote Originally Posted by kika_6 View Post
    I'm trying to change the background color of the center column. I'd like it to be different for the index page and the product pages. In experimenting on my own, it seems that what I need to do is assign a class to the "<td>" containing the center column content. The problem is making it dynamic, so that the index page is different from the product pages. The line I'm trying to edit in "tpl_main_page.php" is:
    <td class="center<?php echo ($xxxx); ?>" valign="top">
    Hopefully, the class will then read something like: "centerindex" or "centercategory".

    I have tried various definitions for the "$xxxx" above. My thought is that I need whichever variable tells the system which file to put in the center column, but being a newcomer to both php and zencart, I can't figure out which variable that is. I don't need any specific name, I just need to vary between the index and product pages and be something consistent which I can style.

    I'd be very appreciative of any ideas or of any better ways to go about this.
    -Jessica
    Create two new stylesheets named as follows:

    index_home.css

    product_info.css



    Now in each one add the following declaration:

    .centerColumn {
    background: #fff;
    }

    change the background to the color you want (for each stylesheet.)

  3. #3
    Join Date
    Jun 2008
    Posts
    2
    Plugin Contributions
    0

    Default Re: vary center column background by page

    You are a gem. Thank you so much. This is exactly what I was overlooking. I only needed to change the background color on the index page, so I made the suggested index_home.css file and made a declaration for #contentMainWrapper, as there was no .centercolumn for the index page. It may not be the solution for anyone else since #contentMainWrapper contains more than just the center column, but it did just what I needed. Thanks again!

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: vary center column background by page

    The per-page stylesheet capability is a wonderful thing, though not the only possibility here.

    Another way to approach this would be to add your code like this:

    <td class="mainColumn" valign="top">

    Something like this should be standard in Zen Cart, because there is presently no way to reference that cell as you can reference the #navColumnOne & #navColumnTwo cells.

    Then you can use the body id which varies by page in combination with .mainColumn:

    #indexHomeBody .mainColumn {background-color: #aabbcc;}

 

 

Similar Threads

  1. How to change background on center column only
    By Goldenis in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 13 Jan 2011, 11:12 PM
  2. Can't get the Center Column Background Image to Fill Page
    By k2moelle in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 5 Sep 2009, 06:56 PM
  3. Changing background of index center column
    By Decostyle in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 15 Jan 2009, 04:21 PM
  4. Change color of background in boxes in center column
    By jaylyns in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 22 Aug 2008, 12:19 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