Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2015
    Location
    Gloucestershire
    Posts
    24
    Plugin Contributions
    0

    Default Turn off left sidebox in all but categories page

    Hi

    I am trying to turn off the left sidebox for all pages apart from the categories-product page, i have a sidebox on this which needs to be on to filter results.

    At the minute i have the below code in the main page to turn off the sidebox on the main page and the product info page.

    PHP Code:
    if ($_GET['main_page'] == 'index' and $current_category_id=='') {
      
    $flag_disable_left true;
      }
      
     if (
    $current_page_base == 'product_info') {
      
    $flag_disable_left true;
      } 
    I could re-write this loads of times to include every page barring the categories product page. However this will be painstaking and no doubt will mean i miss some.

    Is there a way to turn the sidebox off in admin but then have a similar statement as above to turn it on, only when on the category-product page?

  2. #2
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Turn off left sidebox in all but categories page

    Yes,

    Manual Bypass:
    turn the switch in admin off, then manually bypass the switch on the single page you want to see the sidebox - by calling it outside the original 'flag' code.

    or

    Altering Existing Code:
    turn the switch in admin off, on the page you want the code, turn it on manually - within the 'flag is off' code
    Last edited by twitchtoo; 4 Mar 2015 at 08:07 PM.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  3. #3
    Join Date
    Feb 2015
    Location
    Gloucestershire
    Posts
    24
    Plugin Contributions
    0

    Default Re: Turn off left sidebox in all but categories page

    Thanks for the response.

    I have editted the code on the main page which calls the left column as below:

    From

    PHP Code:
    if (COLUMN_LEFT_STATUS == || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != or $_SESSION['customer_id'] == ''))) {
      
    // global disable of column_left
      
    $flag_disable_left true;

    To:

    PHP Code:
    if ($current_page_base == 'products_info') {
      
    $flag_disable_left false;
      }
      else
      {
    if (
    COLUMN_LEFT_STATUS == || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != or $_SESSION['customer_id'] == ''))) {
      
    // global disable of column_left
      
    $flag_disable_left true;
    }} 
    This works, have tested and it works, left column displays on the product info page. However i need it to appear only on the category product list therefore need to changer the below:

    PHP Code:
    $current_page_base == 'product_info' 
    However for the life of me cannot remember/figure out the page base name i need to enter, tried products_all, product_listing and neither worked.

    Any suggestions?

  4. #4
    Join Date
    Feb 2015
    Location
    Gloucestershire
    Posts
    24
    Plugin Contributions
    0

    Default Re: Turn off left sidebox in all but categories page

    Right ive probably done this a really long winded way but figured it out myself:

    PHP Code:
    <?php
    if (($current_page_base == ($_GET['main_page'] == 'index' and $current_category_id==(isset($_GET['current_category_id']) ? $_GET['current_category_id'] : $current_category_id))) and ($current_page_base != ($_GET['main_page'] == 'index' and $current_category_id==''))){
      
    $flag_disable_left false;
      }
      else
      {
    if (
    COLUMN_LEFT_STATUS == || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != or $_SESSION['customer_id'] == ''))) {
      
    // global disable of column_left
      
    $flag_disable_left true;
    }}
    if (!isset(
    $flag_disable_left) || !$flag_disable_left) {
    ?>
    No problems as yet

  5. #5
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Turn off left sidebox in all but categories page

    Quote Originally Posted by Matthew Kin View Post
    Right ive probably done this a really long winded way but figured it out myself:

    PHP Code:
    <?php
    if (($current_page_base == ($_GET['main_page'] == 'index' and $current_category_id==(isset($_GET['current_category_id']) ? $_GET['current_category_id'] : $current_category_id))) and ($current_page_base != ($_GET['main_page'] == 'index' and $current_category_id==''))){
      
    $flag_disable_left false;
      }
      else
      {
    if (
    COLUMN_LEFT_STATUS == || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != or $_SESSION['customer_id'] == ''))) {
      
    // global disable of column_left
      
    $flag_disable_left true;
    }}
    if (!isset(
    $flag_disable_left) || !$flag_disable_left) {
    ?>
    No problems as yet
    Nice work.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

 

 

Similar Threads

  1. v151 How to turn off left column for one category and all of its sub categories?
    By WayneStephens in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 8 Jul 2016, 07:50 PM
  2. v139h Turn off categories sidebox for ==Main_Pages?
    By obrien48 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 29 Jan 2012, 06:40 PM
  3. How to turn off the left sidebox on product info page?
    By lina0962 in forum Basic Configuration
    Replies: 1
    Last Post: 31 Aug 2010, 12:07 AM
  4. Turn Off All Products in Category Sidebox
    By bekinky in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 9 Aug 2010, 12:50 AM
  5. Turn Off Sub-Categories in Sidebox
    By jacque427 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 26 Dec 2006, 03:01 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