Page 9 of 19 FirstFirst ... 7891011 ... LastLast
Results 81 to 90 of 189
  1. #81
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Show/Hide sideboxes based on page

    Mmm yeah... posting at 3am... too tired to articulate that the individual sideboxes need to be controlled in their respective files and not in tpl_main_page:)

  2. #82
    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
    Just curious ... are you trying to turn off individual sideboxes or are you trying to turn off columns?

    These variables and their values:
    $flag_disable_left = true;
    $flag_disable_right = true;

    are used to control the left and right columns ... and, when placed correctly in the code the whole column will turn off ...

    If you want to turn off individual sideboxes, look at how the featured.php sidebox module is written where you see:
    Code:
    // test if box should display
      $show_featured= true;
    
      if ($show_featured == true) {
    currently, nothing "controls" or changes that sidebox but the code is there so that you "could" change when this shows such as only show the sidebox when on the main page:
    Code:
    // test if box should display
      $show_featured= true;
    
    if (!$this_is_home_page) {
      $show_featured= false;
    }
      if ($show_featured == true) {
    Notice on this sidebox how the IF statement surrounds the whole code ...

    Any sidebox where this type of IF does not exist, you can set it up yourself to have similar logic ...
    Individual sideboxes...I will try it tonight. Thank you!

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

    Default Re: Show/Hide sideboxes based on page

    Quote Originally Posted by gjh42 View Post
    Mmm yeah... posting at 3am... too tired to articulate that the individual sideboxes need to be controlled in their respective files and not in tpl_main_page:)
    Dontcha just hate helpin' in your sleep ... then waking up to find out what you really said versus what you thought you meant?
    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. #84
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    I am not good at this... I tried your code with includes/modules/sideboxes/temp file/testimonials_manager. And it still did not work.

    HTML Code:
    // test if box should display
     $show_featured= true;
    if (!$this_is_home_page) {
      $show_featured= false;
    }
      if ($show_featured == 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
    I also tried it with changing the word featured to testimonials_manager....it takes sidebox and footer and everything off.

    HTML 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

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

    Default Re: Show/Hide sideboxes based on page

    I changed my code for the featured sidebox module to:
    Code:
    // test if box should display
      $show_featured= true;
    
    if (!$this_is_home_page) {
      $show_featured= false;
    }
    and only see the Featured Sidebox on the Home Page ...

    Now, let's check a few things ...

    1 What version of Zen Cart?

    2 When you say Featured Sidebox ... you do mean the Featured Sidebox in the Left or Right Column, correct?

    3 What happens if you switch to Classic Template

    4 Are you using templates and overrides?

    5 in the Tools ... Developers Tool Kit ... if you do a search for:
    if ($show_featured == true) {

    what files come up, as in where are they located?
    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. #86
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Show/Hide sideboxes based on page

    Also check the IF statements ... do they ALL have closing brackets?

    I am seeing an odd number in what you displayed ...
    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!

  7. #87
    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
    I changed my code for the featured sidebox module to:
    Code:
    // test if box should display
      $show_featured= true;
    
    if (!$this_is_home_page) {
      $show_featured= false;
    }
    and only see the Featured Sidebox on the Home Page ...

    Now, let's check a few things ...

    1 What version of Zen Cart? 1.3.8a

    2 When you say Featured Sidebox ... you do mean the Featured Sidebox in the Left or Right Column, correct? the sideboxes on both left or right columns they are newsletter called subscribe, testimonials_manager, links sidebox

    3 What happens if you switch to Classic Template

    4 Are you using templates and overrides? Yes

    5 in the Tools ... Developers Tool Kit ... if you do a search for:
    if ($show_featured == true) {

    It is located at: includes/modules/sideboxes/featured.php

    what files come up, as in where are they located?
    I went to includes/modules/sideboxes/temp name/testimonials_manager.php

    inserted this code at top
    HTML Code:
    $show_featured= true;
    
    if (!$this_is_home_page) {
      $show_featured= false;
    }
    I even tried it with changing featured to testimonials_manager and did not work.
    Should I put code into includes/templates/temp file/sideboxes/tpl_testimonials_manager.php instead?

  8. #88
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Show/Hide sideboxes based on page

    No ... you need to post your code for the testimonial manager from the first line to the last line so we can see that you have balanced all of the IF statements ...
    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!

  9. #89
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    includes/modules/sideboxes/temp/testimonials_manager.php

    HTML Code:
    // test if box should display
    $show_featured= true;
    
    if (!$this_is_home_page) {
      $show_featured= false;
    }
    
    $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

  10. #90
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Show/Hide sideboxes based on page

    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 ...
    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!

 

 
Page 9 of 19 FirstFirst ... 7891011 ... 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