Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2011
    Posts
    226
    Plugin Contributions
    0

    Default quick CSS question

    Hi

    I would like to know how to display a certain sidebox for product info pages only. Just like manufacturers is only displayed for product info pages.

    It will be content within a blank sidebox.

    Is it a CSS entry I have to add?

    Thanks for the help
    S

  2. #2
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: quick CSS question

    Is it a CSS entry I have to add?
    Quick answer - no - you need a conditional php statement.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Sep 2011
    Posts
    226
    Plugin Contributions
    0

    Default Re: quick CSS question

    Quote Originally Posted by Kim View Post
    Quick answer - no - you need a conditional php statement.
    Ok.. and that would be

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: quick CSS question

    Some variation of this:

    https://www.zen-cart.com/tutorials/i...hp?article=270

    or you could use page-specific stylesheets that didn't display that sidebox.

  5. #5
    Join Date
    Sep 2011
    Posts
    226
    Plugin Contributions
    0

    Default Re: quick CSS question

    Quote Originally Posted by stevesh View Post
    Some variation of this:

    https://www.zen-cart.com/tutorials/i...hp?article=270

    or you could use page-specific stylesheets that didn't display that sidebox.
    Alright, so what would I change home page to? Product info page?

    PHP Code:
      if ($this_is_home_page) {
        
    $show_featured true;
      } else {
        
    $show_featured false;
      } 
    Thanks again

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,522
    Plugin Contributions
    127

    Default Re: quick CSS question

    In your sidebox file

    includes/templates/YOUR-TEMPLATE-NAME/sideboxes/tpl_YOUR_SIDEBOX.php

    around where you update $content[] to add the content, say something like

    if ($current_page_base != "product_info") {
    ... content code
    }
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  7. #7
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: quick CSS question

    You might be able to do it with CSS... but it is a bit "clunky"

    Create a blank sidebox, but give it a specific name, following the conventions for naming a sidebox.

    Then, in your MAIN stylesheet:

    Add the following at the bottom:

    #YOURSIDEBOXNAME.leftBoxContainer {display:none;}

    (This will be SITE-WIDE).

    Then, create a PRODUCT-SPECIFIC stylesheet, to override the otherwise site-wide declaration:

    p_12345.css (where 12345 is the product ID)

    Into THAT stylesheet, put:

    #YOURSIDEBOXNAME.leftBoxContainer {display:block;}

    naturally, if it is in the RIGHT column...

    .leftBoxContainer becomes .rightBoxContainer
    20 years a Zencart User

  8. #8
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: quick CSS question

    I just re-read your original post... You want the sidebox for ALL product info pages... not just one.

    My solution will be specific to a single PRODUCT... not the product info system in general.
    20 years a Zencart User

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

    Default Re: quick CSS question

    If you are starting from the Blank Sidebox mod, there is already code to handle conditional display. You only need to set the condition.

    In /includes/modules/sideboxes/YOUR-TEMPLATE-NAME/YOUR_SIDEBOX.php, find this (adjust to your sidebox name):
    PHP Code:
      // test if box should display
      
    $show_blank_sidebox true;

      if (
    $show_blank_sidebox == true) { 
    Change
    $show_blank_sidebox = true;
    to
    $show_blank_sidebox = true;
    if ($current_page_base != "product_info") $show_blank_sidebox = false;
    PHP Code:
      // test if box should display
      
    $show_blank_sidebox true;
      if (
    $current_page_base != "product_info"$show_blank_sidebox false;

      if (
    $show_blank_sidebox == true) { 

  10. #10
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: quick CSS question

    Amazing... you can always trust Glenn to provide the best and most practical answers!
    20 years a Zencart User

 

 

Similar Threads

  1. Quick Re-Orders .css problem
    By tpeck in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 3 Oct 2014, 04:55 AM
  2. 2 quick (hopefully) css questions
    By customk1 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 12 Aug 2010, 10:44 PM
  3. Just a quick question about a part of my CSS
    By ymbd in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 15 Aug 2008, 08:02 PM
  4. Quick css question navCatTabs
    By red8ii8 in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 2 Jul 2007, 08:40 PM
  5. CSS Flyout Quick Question
    By zberke in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 24 Feb 2007, 01:12 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