Page 8 of 19 FirstFirst ... 67891018 ... LastLast
Results 71 to 80 of 189
  1. #71

    Default Re: Show/Hide sideboxes based on page

    Quote Originally Posted by gjh42 View Post
    If you want the sidebars to go away completely on those pages, you would put that in tpl_main_page.php, and use it to set $flag_disable_left and $flag_disable_right.
    PHP Code:
    if (in_array($current_page_baseexplode(',','about_cool_tech,cool_tech_values,inside_cool_tech,giving_back,think_green,tech_support,discount-coupon'))){
    //skip these pages
      
    $flag_disable_left true;
      
    $flag_disable_right true;
    } else {
      
    $flag_disable_left false;
      
    $flag_disable_right false;

    This would go near the top of the file - look at it for guidance.
    I just wanted the categories and testimonials to not show up on the pages, I apologize for not being more specific.
    Rich People scream, Wealthy people whisper

    www.cooltechcentral.com

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

    Default Re: Show/Hide sideboxes based on page

    Ah ok, in that case you would wrap the test around all of the executable code in the categories.php and testimonials.php module files, or possibly the tpl_ files, I don't recall which at the moment (check on their exact names).

    Yes (post 62), categories.php and testimonials.php.

  3. #73

    Default Re: Show/Hide sideboxes based on page

    Would the executable code be:

    require ($template->get_template_dir('tpl_testimonials.php', DIR_WS_TEMPLATE, $current_page_base, 'sideboxes'). '/tpl_testimonials.php');
    require ($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base, 'common') . '/' . $column_box_default);
    For includes/modules/sideboxes/my_template/testimonials.php

    and:

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

    $title = BOX_HEADING_CATEGORIES;
    $title_link = false;

    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
    For includes/modules/sideboxes/my_template/categories.php

    If so I rapped this bit of code around them:

    if(in_array($_GET['main_page'],explode(',','about_cool_tech,cool_tech_values,inside_cool_tech,giving_back,thin k_green,tech_support,discount-coupon'))){
    }
    but it didn't work.
    Rich People scream, Wealthy people whisper

    www.cooltechcentral.com

  4. #74
    Join Date
    Dec 2008
    Posts
    6
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    Quote Originally Posted by dealbyethan.com View Post
    Add this to tpl_main_page.php

    $center_column_only = array('checkout');
    Where in the page is this added?

  5. #75
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    I am somewhat confused with coding as I go through this thread.

    My goal is to hide certain sideboxes from the product pages. But, do not see sideboxes for them. Sideboxes to hide: newsletter, links, testimonials, and About Us.

    Which file? I think this may be code? Where should it go in file at?

    HTML Code:
    if (in_array($current_page_base, explode(',','about_cool_tech,cool_tech_values,inside_cool_tech,giving_back,think_green,tech_support,discount-coupon'))){
    //skip these pages
    } else {
    
    //...execute the code
    
    }  
    Thanks, Kim

  6. #76
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    Quote Originally Posted by kburner View Post
    I am somewhat confused with coding as I go through this thread.

    My goal is to hide certain sideboxes from the product pages. But, do not see sideboxes files for them. Sideboxes to hide: newsletter, links, testimonials, and About Us.

    Which file? I think this may be code? Where should it go in file at?

    HTML Code:
    if (in_array($current_page_base, explode(',','about_cool_tech,cool_tech_values,inside_cool_tech,giving_back,think_green,tech_support,discount-coupon'))){
    //skip these pages
    } else {
    
    //...execute the code
    
    }  
    Thanks, Kim
    Anyone?

  7. #77
    Join Date
    Apr 2008
    Location
    Flint, Michigan
    Posts
    687
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    I want to hide certain sideboxes from product pages or basically keep only on main page. I went to includes/template/my temp/common/tpl_main_page. I added this code to keep only on main page for links side box, newsletter side box(subscribe), testimonials side box and About Us (ezpages).

    $main_page_only = array('testimonials-manager','subscribe','linksbox','ezpages');
    if (in_array($current_page_base,$main_page_only) ) {
    $flag_disable_right = true;
    $flag_disable_left = true;
    }

    I still can not get it to work.

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

    Default Re: Show/Hide sideboxes based on page

    If you really want those sideboxes only on the home page, use
    PHP Code:
    if (!$this_is_home_page){
      
    $flag_disable_left true;
      
    $flag_disable_right true;

    or to target just those pages
    PHP Code:
    if (in_array($current_page_baseexplode(',','testimonials-manager,subscribe,linksbox,ezpages'))){
      
    $flag_disable_left true;
      
    $flag_disable_right true;

    I know this should be equivalent to the test you posted, but I have successfully used this version many times.

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

    Default Re: Show/Hide sideboxes based on page

    Quote Originally Posted by gjh42 View Post
    If you really want those sideboxes only on the home page, use
    PHP Code:
    if (!$this_is_home_page){
      
    $flag_disable_left true;
      
    $flag_disable_right true;

    or to target just those pages
    PHP Code:
    if (in_array($current_page_baseexplode(',','testimonials-manager,subscribe,linksbox,ezpages'))){
      
    $flag_disable_left true;
      
    $flag_disable_right true;

    I know this should be equivalent to the test you posted, but I have successfully used this version many times.
    I do not know what I am doing wrong. I put it as the top of the page in includes/template/my temp/common/tpl_main_page....I will work on it some more..

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

    Default Re: Show/Hide sideboxes based on page

    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 ...
    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: v1.5.5]
    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 8 of 19 FirstFirst ... 67891018 ... 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

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