If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / Turn off left sidebox in all but categories page

Turn off left sidebox in all but categories page

Started by matthew_kin on 4 Mar 2015, 5:41 PM · Views: 798

Results 1 to 5 of 5
4 Mar 2015, 5:41 PM
#1
matthew_kin avatar

matthew_kin

New Zenner

Join Date:
Feb 2015
Location:
Gloucestershire
Posts:
24
Plugin Contributions:
0

Post #1 by matthew_kin

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.

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?

4 Mar 2015, 7:04 PM
#2
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Post #2 by twitchtoo

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

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

5 Mar 2015, 11:18 AM
#3
matthew_kin avatar

matthew_kin

New Zenner

Join Date:
Feb 2015
Location:
Gloucestershire
Posts:
24
Plugin Contributions:
0

Post #3 by matthew_kin

Thanks for the response.

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

From

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;
}

To:

if ($current_page_base == 'products_info') {
  $flag_disable_left = false;
  }
  else
  {
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;
}}

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:

$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?

5 Mar 2015, 12:13 PM
#4
matthew_kin avatar

matthew_kin

New Zenner

Join Date:
Feb 2015
Location:
Gloucestershire
Posts:
24
Plugin Contributions:
0

Post #4 by matthew_kin

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

<?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 == 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 (!isset($flag_disable_left) || !$flag_disable_left) {
?>

No problems as yet

5 Mar 2015, 12:53 PM
#5
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Post #5 by twitchtoo

Matthew Kin:

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

<?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 == 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 (!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.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian