Page 10 of 19 FirstFirst ... 89101112 ... LastLast
Results 91 to 100 of 189
  1. #91
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    It hide the side box on product page, but also hides footer, banners, everything else from where side box was down.

  2. #92
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    Quote Originally Posted by Ajeh View Post
    Try this code, instead:
    Code:
    // test if box should display
    $show_testimonials_manager= true;
    
    if (!$this_is_home_page) {
      $show_testimonials_manager= false;
    }
    
    if ($show_testimonials_manager == true) {
      $page_query = $db->Execute("select testimonials_id, testimonials_image, testimonials_title, testimonials_html_text, date_added  from " . TABLE_TESTIMONIALS_MANAGER . " where status = 1  and language_id = " . (int)$_SESSION['languages_id'] . " order by rand(), testimonials_title limit " . MAX_DISPLAY_TESTIMONIALS_MANAGER_TITLES ."");
      if ($page_query->RecordCount()>0) {
          $title =  BOX_HEADING_TESTIMONIALS_MANAGER;
          $box_id =  testimonials_manager;
          $rows = 0;
          while (!$page_query->EOF) {
            $rows++;
            $page_query_list[$rows]['id'] = $page_query->fields['testimonials_id'];
            $page_query_list[$rows]['name']  = $page_query->fields['testimonials_title'];
            $page_query_list[$rows]['story']  = $page_query->fields['testimonials_html_text'];
    		$page_query_list[$rows]['image'] = $page_query->fields['testimonials_image'];
    
            $page_query->MoveNext();
          }
          $left_corner = false;
          $right_corner = false;
          $right_arrow = false;
          $title_link = false;
          require($template->get_template_dir('tpl_testimonials_manager.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_testimonials_manager.php');
          require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
        }
    }
    //EOF
    The variable:
    $show_testimonials_manager

    could be called anything ... but I like them to match the name of the sidebox ... plus, you do not want to repeat the same variables in sideboxes to avoid issues ...

    But ... the variable must match the IF statement test ...
    I tried it again and it worked this time!

  3. #93
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Show/Hide sideboxes based on page

    <insert dancing here> ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #94
    Join Date
    Dec 2009
    Location
    Sarajevo
    Posts
    80
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    Great topic, exactly what I am looking for

    I hope you can help me with this:

    1. I would like to hide categories and chcategories (Categories Dressing) sideboxes on these two pages/links

    /index.php?main_page=contact_us
    /index.php?main_page=news_archiv

    2. Also, I need to hide standard categories sidebox in these categories (cPaths)

    index.php?main_page=index&cPath=148
    index.php?main_page=index&cPath=146

    I am not sure is this possible to do with css trick as Kuroi mentioned on first page, or editing 'common/tpl_main_page.php' and how?

    Thnx in advance, all suggestions are welcome

  5. #95
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Show/Hide sideboxes based on page

    It would be similar where you can setup an IF around the code, if it doesn't exist already and the $show_my_sidebox would be whatever variable you are using in that sidebox ...
    Code:
    if ($_GET['main_page']=='contact_us' or $_GET['main_page']=='news_archiv') {
      $show_my_sidebox = false;
    }
    For the cPath you can use:
    $_GET['cPath']

    For the current categories_id you can use:
    $current_category_id
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #96
    Join Date
    Dec 2009
    Location
    Sarajevo
    Posts
    80
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    Quote Originally Posted by Ajeh View Post
    It would be similar where you can setup an IF around the code, if it doesn't exist already and the $show_my_sidebox would be whatever variable you are using in that sidebox ...
    Code:
    if ($_GET['main_page']=='contact_us' or $_GET['main_page']=='news_archiv') {
      $show_my_sidebox = false;
    }
    For the cPath you can use:
    $_GET['cPath']

    For the current categories_id you can use:
    $current_category_id
    huh as I am still new zenner I dont now where to start: where should I insert this code? I assume it need sto be inserted in '/templates/mytemplate/common/tpl_main_page.php'? I tryed to set this code in tpl_main_page.php

    Code:
    if ($_GET['main_page']=='contact_us' or $_GET['main_page']=='news_archiv') {
      $show_my_sidebox = false;
    }
    exactly bellow this part of ocde:

    Code:
     
    the following IF statement can be duplicated/modified as needed to set additional flags
     if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
        $flag_disable_right = true;
      }
    looking like this
    Code:
     the following IF statement can be duplicated/modified as needed to set additional flags
      if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
        $flag_disable_right = true;
      }
    
    if ($_GET['main_page']=='contact_us' or $_GET['main_page']=='news_archiv') {
      $show_my_sidebox = false;
    }
    but nothing happens. Also I tryed replacing "$show_my_sidebox = false;" with "$show_categories = false;" but still nothing changes..

  7. #97
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Show/Hide sideboxes based on page

    This code is designed for the individual sideboxes ...

    If you look at how the specials sidebox is done in the:
    /includes/modules/sideboxes/specials.php

    Code:
    // test if box should display
      $show_specials= false;
    
      if (isset($_GET['products_id'])) {
        $show_specials= false;
      } else {
        $show_specials= true;
      }
    
      if ($show_specials == true) {
    // all the code that makes the box here    }
      }
    This sidebox uses:
    $show_specials

    because it matches the sidebox name ... it could use $fred but that wouldn't make sense for easy coding ...

    The idea is, there are conditions set as to when the variable:
    $show_specials is true or false

    The IF around all of the code for:
    if ($show_specials == true) {

    makes this sidebox show or not show when the various conditions are true ...

    For any sidebox, the same logic can be built ...

    1 you need the logical tests for when to show or not show a sidebox

    2 the code that makes the sidebox display must be surrounded by an IF statement such as:
    Code:
      if ($show_specials == true) {
    // all the code that makes the box here
      }
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

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

    Default Re: Show/Hide sideboxes based on page

    In this case, both #categories and #chcategories use the same template file (tpl_categories.php) - that's the way fragfutter set it up for chcategories, and it conveniently worked with Categories Dressing.

    You can control the sideboxes separately by using the test in the module files. In /includes/modules/sideboxes/your_template/ch_categories.php, find this:
    PHP Code:
    //CHRISTOPH BOF
    require_once (DIR_WS_CLASSES 'ch_categories_tree_generator.php'); 
    and add above it
    PHP Code:
    $show_chcategories true;
    if (
    $_GET['main_page']=='contact_us' or $_GET['main_page']=='news_archiv') {
      
    $show_chcategories false;
    }
    if (
    $show_chcategories){ 
    and at the bottom of the file just before the ?>, add } to get
    PHP Code:
    }?> 
    Do the same kind of thing in /includes/modules/sideboxes/your_template/categories.php, to get
    PHP Code:
    $show_categories true;
    if (
    $_GET['main_page']=='contact_us' or $_GET['main_page']=='news_archiv' or (int)$_GET['cPath']=='146' or (int)$_GET['cPath']=='148') {
      
    $show_categories false;
    }
    if (
    $show_categories){

        
    $main_category_tree = new category_tree;
        
    $row 0
    and
    PHP Code:
    }?> 
    Last edited by gjh42; 7 Feb 2010 at 09:32 PM.

  9. #99
    Join Date
    Dec 2009
    Location
    Sarajevo
    Posts
    80
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    @Ajeh

    thnx for detail explanation, it helped me better understand how sideboxes based on page working


    Quote Originally Posted by gjh42 View Post
    In this case, both #categories and #chcategories use the same template file (tpl_categories.php) - that's the way fragfutter set it up for chcategories, and it conveniently worked with Categories Dressing.

    You can control the sideboxes separately by using the test in the module files. In /includes/modules/sideboxes/your_template/ch_categories.php, find this:
    PHP Code:
    //CHRISTOPH BOF
    require_once (DIR_WS_CLASSES 'ch_categories_tree_generator.php'); 
    and add above it
    PHP Code:
    $show_chcategories true;
    if (
    $_GET['main_page']=='contact_us' or $_GET['main_page']=='news_archiv') {
      
    $show_chcategories false;
    }
    if (
    $show_chcategories){ 
    and at the bottom of the file just before the ?>, add } to get
    PHP Code:
    }?> 
    Do the same kind of thing in /includes/modules/sideboxes/your_template/categories.php, to get
    PHP Code:
    $show_categories true;
    if (
    $_GET['main_page']=='contact_us' or $_GET['main_page']=='news_archiv' or (int)$_GET['cPath']=='146' or (int)$_GET['cPath']=='148') {
      
    $show_categories false;
    }
    if (
    $show_categories){

        
    $main_category_tree = new category_tree;
        
    $row 0
    and
    PHP Code:
    }?> 
    as always Glenn, your code works like charm Thanks man

    also now I understand this code better how it exactly works so I tryed this code on other two additional sideboxes I have on my site (custom Blank sidebox from author Kuroi) and its all working great

  10. #100
    Join Date
    Feb 2010
    Posts
    1
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    Hi all,
    Noob here.

    Exhaustively read entire thread and did not see an answer to the following question...

    How do I keep the manufacturer_info side box from disappearing when listing a manufacturer's products?
    ie. /index.php?main_page=index&manufacturers_id=8

    Doesn't make sense to show manufacturer_info box when all a manufacturer's products are displayed?

    Take a look at the site:
    sidebox missing from specific manufacturer product list
    http://www.regionalmarketplace.us/ca...facturers_id=8

    individual products show sidebox:
    http://www.regionalmarketplace.us/ca...roducts_id=181

    Any help is greatly appreciated.

 

 
Page 10 of 19 FirstFirst ... 89101112 ... LastLast

Similar Threads

  1. 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
  2. Show/Hide INformation Sidebox based on page
    By atracksler in forum Basic Configuration
    Replies: 12
    Last Post: 17 Jun 2011, 04:21 PM
  3. 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
  4. Hide sideboxes on main page
    By disciple in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 11 Jan 2007, 07:38 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