Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Jan 2006
    Posts
    54
    Plugin Contributions
    0

    Default Show/Hide INformation Sidebox based on page

    I would like to Hide the Information sidebox, except on:
    index.php?main_page=page&id=2&chapter=0

    How do I set up a conditional statement to check for this in information.php??

  2. #2
    Join Date
    Sep 2006
    Posts
    32
    Plugin Contributions
    0

    Default Re: Show/Hide INformation Sidebox based on page

    I too am looking for this solution.

    Any help would be greatly appreciated!! Thanks.

  3. #3
    Join Date
    Sep 2006
    Posts
    32
    Plugin Contributions
    0

    Default Re: Show/Hide INformation Sidebox based on page

    Here is one way to do it; it may not be the best, but it appears to work.

    If you put a conditional statement around the two requires at the bottom of information.php, then you can force it to display only on certain pages.

    For example, in information.php there is:
    -----
    require($template->get_template_dir('tpl_information.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_information.php');

    $title = BOX_HEADING_INFORMATION;
    $title_link = false;

    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    -----

    if you wrap this with a conditional, such as:
    ---
    if( $_GET['main_page'] == 'page' && $_GET['id'] == '2' && $_GET['chapter'] == '0') {

    require($template->get_template_dir('tpl_information.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_information.php');

    $title = BOX_HEADING_INFORMATION;
    $title_link = false;

    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);

    }
    -----
    you should see the information box only on that specific ez page. It appears to work for me. I'm sure there are other variables that could be tested that may be more reliable. Anybody got ideas on how to improve this conditional?

    Thanks,
    Steve

  4. #4
    Join Date
    Mar 2007
    Location
    Pepperell, Massachusetts
    Posts
    232
    Plugin Contributions
    1

    Default Re: Show/Hide INformation Sidebox based on page

    I cannot answer your question, but I'm also looking for a more generalized "conditional" sidebox. I've created by own sidebox which appears to work nicely. However, I don't want it shown all the time-- I have a variable I test. I can test for this inside the sidebox content, but that doesn't cover it's header.

    Anyone have a more general place to conditionalize a sidebox visibility?

  5. #5
    Join Date
    Jul 2007
    Posts
    8
    Plugin Contributions
    0

    Default Re: Show/Hide INformation Sidebox based on page

    Quote Originally Posted by dhcernese View Post
    Anyone have a more general place to conditionalize a sidebox visibility?
    I used the CSS solution suggested by gjh42 in a related thread:

    http://www.zen-cart.com/forum/showthread.php?t=75199

    Add the last box of code from post#2 to your stylesheet and edit as needed. Works great for me and is very easy to implement!

    Lisa

  6. #6
    Join Date
    Mar 2007
    Location
    Pepperell, Massachusetts
    Posts
    232
    Plugin Contributions
    1

    Default Re: Show/Hide INformation Sidebox based on page

    Quote Originally Posted by binary View Post
    I used the CSS solution suggested by gjh42 in a related thread:

    http://www.zen-cart.com/forum/showthread.php?t=75199

    Add the last box of code from post#2 to your stylesheet and edit as needed. Works great for me and is very easy to implement!

    Lisa
    Thank you for the pointer!

  7. #7
    Join Date
    Mar 2010
    Posts
    2
    Plugin Contributions
    0

    Default Re: Show/Hide INformation Sidebox based on page

    There is a detailed tutorial on the correct way to do this here:
    https://www.zen-cart.com/tutorials/i...hp?article=270

    --Regards,
    Ken

  8. #8
    Join Date
    Aug 2006
    Location
    portlandish, oregon
    Posts
    799
    Plugin Contributions
    0

    Default Re: Show/Hide INformation Sidebox based on page

    What would be the correct syntax to accomplish this for

    /index.php?main_page=product_info&products_id=4

    I need a couple sidebox NOT to show on this page.
    Last edited by khopek; 17 Apr 2010 at 10:27 PM.

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

    Default Re: Show/Hide INformation Sidebox based on page

    if (!($current_page_base == 'product_info' and $products_id == '4')) {

    There are several possible minor variations on this.

  10. #10
    Join Date
    Aug 2006
    Location
    portlandish, oregon
    Posts
    799
    Plugin Contributions
    0

    Default Re: Show/Hide INformation Sidebox based on page

    Perfect, thanks for the quick response. I new the page would be product_info, but was not sure what the rest was.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Show/Hide sideboxes based on page
    By JeffD in forum General Questions
    Replies: 188
    Last Post: 21 May 2015, 10:10 PM
  2. v150 Any way to show/hide payment modules dynamically based on order total?
    By Limitless in forum Addon Payment Modules
    Replies: 2
    Last Post: 27 Sep 2012, 03:22 PM
  3. CSS Show/Hide Category Sidebox
    By andreitero in forum Addon Sideboxes
    Replies: 0
    Last Post: 13 Aug 2010, 12:54 PM
  4. Show/Hide sideboxes based on page
    By monkeyjr47906 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 29 Nov 2007, 07:25 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR