Zen Cart Logo
Forums / General Questions / Show/Hide sideboxes based on page

Show/Hide sideboxes based on page

Views: 43,781

Results 181 to 189 of 189
19 May 2015, 7:04 AM
#181
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Show/Hide sideboxes based on page

marton_1:

Sorry to drag up an old thread.

I have been experimenting with not showing side columns on certain pages.

I used the prepared code in tpl_main_page.php to stop columns on the home page which works fine.

But does not stop columns for other pages, I assume the page name is this guy? <title>Accessories</title>
So the code to I used is
if (in_array($current_page_base,explode(",",'Accessories')) ) {
$flag_disable_right = true;
}

Probably I did something dumb :(

<title>Accessories</title>

Post a link to your site please.

19 May 2015, 10:40 AM
#183
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Show/Hide sideboxes based on page

marton_1:

Thank you for your interest.

Here is a link to my site page in question, this page is in English - the site pages are also in German language!

http://www.simmar.ch/catalog/index.php?main_page=index&language=en&cPath=81_67

You may want to try

if (in_array($current_page_base,explode(",",'cPath=81_67')) ) {
$flag_disable_right = true;
} 

I could be wrong though.....

19 May 2015, 2:45 PM
#184
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

frank18:

You may want to try

if (in_array($current_page_base,explode(",",'cPath=81_67')) ) {
$flag_disable_right = true;
}

> 
> I could be wrong though.....

Good idea but did not work.  I also tried with the full url but no luck.
19 May 2015, 3:31 PM
#185
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Show/Hide sideboxes based on page

I think it was done this way, but I have not tried.

if (in_array($current_page_base,explode(",",'index&cPath=81_67')) ) {
$flag_disable_right = true;
}  
20 May 2015, 10:43 PM
#186
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Sadly still does not work.

I also tried stopping side boxes in EZ pages with the following but also did not work - luckily I can turn these off in the admin.

// the following IF statement stops side columns on EZ *
if (in_array($ezpage_id,explode(",",'2,5'))) {
$flag_disable_right = true;
}

I am using V1.5.1 with the classic green template :)

21 May 2015, 1:26 AM
#187
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Show/Hide sideboxes based on page

If you want to turn it off when the category is 67, have you tried:

if ($current_category_id == 67 ) {
  $flag_disable_right = true;
}
21 May 2015, 8:19 PM
#188
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Ajeh:

If you want to turn it off when the category is 67, have you tried:

if ($current_category_id == 67 ) {
$flag_disable_right = true;
}


Great, that works

Many many thanks
21 May 2015, 9:10 PM
#189
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Show/Hide sideboxes based on page

Thanks for the update that this worked for you ... :smile: