Zen Cart Logo
Forums / General Questions / Disable Certain Sidebox on Home Page

Disable Certain Sidebox on Home Page

Locked

Views: 2,424

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
8 Feb 2009, 5:58 PM
#1
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Disable Certain Sidebox on Home Page

I am trying to display certain sideboxes on home page only. I will disabling the right column on the home page, I want to display the Search sidebox in the left column so I cloned the search sidebox and renamed it to search_left_home_page.php.
I edited the code based on other threads I read in the forum about disabling single sidebox on the home page. But now the code I added hides the sidebox on home page and display it on other pages. Here is the link to the site https://www.ohiospeedshop.com and the code I am using is: ```

<?php /** * search sidebox - displays keyword-search field for customer to initiate a search * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: search.php 2834 2006-01-11 22:16:37Z birdbrain $ */ //display on home page only if ($this_is_home_page) { $show_search_left_home_page = false; } else { $show_search_left_home_page = true; require($template->get_template_dir('tpl_search_left_home_page.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_search_left_home_page.php'); $title = '<label>' . BOX_HEADING_SEARCH . '</label>'; $title_link = false; require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default); } ?>
8 Feb 2009, 6:00 PM
#2
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Disable Certain Sidebox on Home Page

pretty simple solution really - just swap the true and false arond in your added code

8 Feb 2009, 7:29 PM
#3
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Disable Certain Sidebox on Home Page

I tried that before posting. If I do that it is disabled on the home page and enabled on all the other pages.

Again what I am trying to do is enable the sidebox on home page ONLY!

8 Feb 2009, 9:19 PM
#4
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Disable Certain Sidebox on Home Page

After furthur testing this is the code that worked for me:
at the top add this

 if ($this_is_home_page && $show_search_left_home_page = true) {

don't forget to close the if statement with }