Zen Cart Logo
Forums / General Questions / Exclude sideboxes from home page only?

Exclude sideboxes from home page only?

Locked

Views: 3,144

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
5 Oct 2007, 8:03 AM
#1
vood avatar

vood

New Zenner

Join Date:
Sep 2007
Posts:
59
Plugin Contributions:
0

Exclude sideboxes from home page only?

I can't seem to find out what the proper code is to insert here.

if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
$flag_disable_right = true;}

I'm wanting to hide all sideboxes on the right side but only on the home page/main page. I'm using a modified AppleZen template that restricts sideboxes to only display on the right side. When I tried to insert the following...

if ($this_is_home_page) {
$flag_disable_left = true;

I get a parce error. Any help would be greatly appreciated.

Vood

5 Oct 2007, 8:34 AM
#3
vood avatar

vood

New Zenner

Join Date:
Sep 2007
Posts:
59
Plugin Contributions:
0

Re: Exclude sideboxes from home page only?

Thanks for the thread ref. but it still isn't working for me. When I replace the code, I'm still seeing the Categories, Reviews and Information boxes on the right side. Sorry to be a pain.

Vood

5 Oct 2007, 8:40 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Exclude sideboxes from home page only?

Vood:

I'm wanting to hide all sideboxes on the **right **side

....

if ($this_is_home_page) {
$flag_disable_**left **= true;

...

Did you choose "right" in both places?

5 Oct 2007, 8:49 AM
#5
vood avatar

vood

New Zenner

Join Date:
Sep 2007
Posts:
59
Plugin Contributions:
0

Re: Exclude sideboxes from home page only?

DrByte:

Did you choose "right" in both places?

I'm not sure what you mean by "in both places". I cut the code from the thread you referred me to and pasted it in place of the existing if statement on the tpl_main_page.php. Should I have kept that one and just added the extra code as follows?

if ($current_page_base == 'index_home' and $cPath == '') {
$flag_disable_left = true;
}

When I tried to add code like that before (not the same code but one that worked for me earlier) I got a parce error.

Vood

5 Oct 2007, 9:02 AM
#6
vood avatar

vood

New Zenner

Join Date:
Sep 2007
Posts:
59
Plugin Contributions:
0

Re: Exclude sideboxes from home page only?

Here is the code as I have it now. There is no effect on the display of the home page.

// the following IF statement can be duplicated/modified as needed to set additional flags
if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
$flag_disable_right = true;
}
if ($current_page_base == 'index_home' and $cPath == '') {
$flag_disable_left = true;
}

Thanks for any help.

Vood

5 Oct 2007, 9:11 AM
#7
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Exclude sideboxes from home page only?

Vood:

if ($this_is_home_page) {
$flag_disable_left = true;This is the right approach to solving the problem that you have stated, but you will get errors, because there's a "}" missing from the end, and it will disable your left column, not your right column.

Vood:

if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
$flag_disable_right = true;
}This won't do anything as there are no pages listed in the array for it to work on.

Vood:

if ($current_page_base == 'index_home' and $cPath == '') {
$flag_disable_left = true;
}This is syntactically correct, but still addresses the left column rather than the right and your first example would be an easier and clearer approach.

5 Oct 2007, 9:16 AM
#8
vood avatar

vood

New Zenner

Join Date:
Sep 2007
Posts:
59
Plugin Contributions:
0

Re: Exclude sideboxes from home page only?

Sorry. I'm not communicating very well. Here is the actual code on the tpl_main_page.php page.

// the following IF statement can be duplicated/modified as needed to set additional flags
if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
$flag_disable_right = true;
}
if ($current_page_base == 'index_home' and $cPath == '') {
$flag_disable_right = true;
}

$header_template = 'tpl_header.php';
$footer_template = 'tpl_footer.php';
$left_column_file = 'column_left.php';
$right_column_file = 'column_right.php';
$body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);

It still doesn't do anything.

Vood

5 Oct 2007, 9:17 AM
#9
vood avatar

vood

New Zenner

Join Date:
Sep 2007
Posts:
59
Plugin Contributions:
0

Re: Exclude sideboxes from home page only?

I have also tried to replace the first if statement with the second one to no avail.

Vood

5 Oct 2007, 9:28 AM
#10
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Exclude sideboxes from home page only?

Apple Zen was coded to have right sideboxes only. Maybe also coded
so that sideboxes cannot be removed..suggest also posting your query in Apple Zen Support thread at
http://www.zen-cart.com/forum/showthread.php?t=71295&highlight=apple+zen

5 Oct 2007, 9:43 AM
#11
vood avatar

vood

New Zenner

Join Date:
Sep 2007
Posts:
59
Plugin Contributions:
0

Re: Exclude sideboxes from home page only?

Thanks so much. I found the info I needed. It is a problem specific to the Applezen. Here is the thread to solve this problem. Thanks again.

Vood

http://www.zen-cart.com/forum/showpost.php?p=337327&postcount=267

5 Oct 2007, 10:10 AM
#12
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Exclude sideboxes from home page only?

Vood:

Thanks so much. I found the info I needed. It is a problem specific to the Applezen. Here is the thread to solve this problem. Thanks again.
Vood
http://www.zen-cart.com/forum/showpost.php?p=337327&postcount=267
No problem, good to hear you have it all sorted.

14 Feb 2008, 9:31 PM
#13
awmg2002 avatar

awmg2002

New Zenner

Join Date:
Feb 2008
Posts:
3
Plugin Contributions:
0

Re: Exclude sideboxes from home page only?

kuroi:

This is the right approach to solving the problem that you have stated, but you will get errors, because there's a "}" missing from the end, and it will disable your left column, not your right column.

This won't do anything as there are no pages listed in the array for it to work on.

This is syntactically correct, but still addresses the left column rather than the right and your first example would be an easier and clearer approach.

Ok, then how would this code work (what would the code be) if I only want to have the sideboxes to disappear on the products and/or featured products pages?:unsure:

14 Feb 2008, 10:08 PM
#14
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Exclude sideboxes from home page only?

awmg2002:

Ok, then how would this code work (what would the code be) if I only want to have the sideboxes to disappear on the products and/or featured products pages?:unsure:This is explained, with example code, in the header to the common/tpl_main_page.php file. You would need to use page names such as featured_products or product_info.