Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2006
    Posts
    1,542
    Plugin Contributions
    0

    Default Turn Off Columns Except for Product Page

    Normally people want to turn off a column, usually the right, for the product pages.

    I'd like to turn off all columns EXCEPT for the right column on the product page, so I can keep the mfr info sidebox:

    http://www.prommart.com/b-dazzle-35422-p-980.html

    I know how to turn off both columns for homepage only in tpl_main_page. And I can just globally turn off the left column.

    Last night I managed to use the tpl_main_page "explode cpath" to turn off the columns for the categories and subcategories. Unfortunately, that also turned off the right column for the products.

    But how to turn off right column for categories/subcategories but leave right column for product?

    Any help appreciated, thanks.

    Steve

    PS: Site currently returned to default three columns.
    Steve
    prommart.com

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,946
    Plugin Contributions
    96

    Default Re: Turn Off Columns Except for Product Page

    If I'm understanding you correctly, you want your "normal" (i.e. as set by your admin) left/right columns to show on all pages except for product_info, where you want only the right sidebox to show. If that's correct, you can edit your /includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php (around line 80 on an unedited v1.5.1 version) to add the lines in red:
    Code:
    if (COLUMN_LEFT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
      // global disable of column_left
      $flag_disable_left = true;
    }
    if ($current_page_base == 'product_info') {
      $flag_disable_left = true;
      $flag_disable_right = false;
    }
    if (!isset($flag_disable_left) || !$flag_disable_left) {

  3. #3
    Join Date
    Jan 2006
    Posts
    1,542
    Plugin Contributions
    0

    Default Re: Turn Off Columns Except for Product Page

    I wanted to ideally turn off ALL columns EXCEPT for the product page. And using your code with my code worked!

    http://www.prommart.com/b-dazzle-35422-p-980.html

    So now only the product page has a column (right) insofar as I yet see. It even turned off the columns for the shipping, conditions, contact us pages, etc.

    Thanks!

    Here is what I have, in case anyone else wants this, all in common/tpl_main_page.php:

    Turned off columns for homepage and my categories and subcategories (at top of tpl main page):

    Code:
    if ($this_is_home_page) { 
       $flag_disable_right = true;
       $flag_disable_left = true;
    }
    
    if (in_array($cPath,explode(",",'1,33,32,10,13,29,9,16,7,3,3_18,3_23,16_17,3_5,29_30,29_31,7_28,13_25,13_26,13_27,3_21,13_14,10_11,3_4,10_15,7_8,10_12,7_24,1_2,19_20,1_6,19,')) ) {
        $flag_disable_left = true;
        $flag_disable_right = true;
      }
    But above also takes out the right column on my product page, which I wanted to leave.

    So I then applied Lat9's code in the place he indicated, which now leaves the right column on for product pages only...what I was looking for:

    Code:
    if ($current_page_base == 'product_info') {
      $flag_disable_left = true;
      $flag_disable_right = false;
    }
    Lat9, thanks again!

    Steve
    Last edited by SPH; 5 Nov 2012 at 07:43 PM.
    Steve
    prommart.com

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

    Default Re: Turn Off Columns Except for Product Page

    Since you only want the right column on product info pages, and can turn off the left column globally in admin, you can simplify all of this code to
    PHP Code:
    if ($current_page_base == 'product_info') {
      
    $flag_disable_right false;
    }else{
      
    $flag_disable_right true;


  5. #5
    Join Date
    Jan 2006
    Posts
    1,542
    Plugin Contributions
    0

    Default Re: Turn Off Columns Except for Product Page

    Quote Originally Posted by gjh42 View Post
    Since you only want the right column on product info pages, and can turn off the left column globally in admin, you can simplify all of this code to
    PHP Code:
    if ($current_page_base == 'product_info') {
      
    $flag_disable_right false;
    }else{
      
    $flag_disable_right true;

    Yes, that works too!

    http://www.prommart.com/b-dazzle-35422-p-980.html

    I guess it is the little else in green.

    Much simpler than my method, and now I don't have to keep adding new categories to the code.

    I did globally turn off the left column in the admin.

    Thanks!

    Steve
    Last edited by SPH; 5 Nov 2012 at 10:14 PM.
    Steve
    prommart.com

 

 

Similar Threads

  1. Turn off right and left columns front page only
    By cshart in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 24 Dec 2010, 04:24 AM
  2. Replies: 24
    Last Post: 16 Nov 2009, 04:20 PM
  3. Possible to turn off left & right columns based on page type?
    By edwardtilbury in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 17 Mar 2009, 04:33 AM
  4. turn off side columns on home page (code example)
    By kiddo in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 9 Feb 2007, 03:59 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