longhorn1999 Posted April 19, 2010 Share Posted April 19, 2010 Hi everyone, I think someone may have asked this recently but I couldn't find a working answer. I need to have a box that only shows up on the home page (mysite.com/index.php or mysite.com/), and I'd like to only modify column_right.php if at all possible to keep things simpler. I've come across this code: if($PHPSELF == ''){ include(DIR_WS_BOXES . 'new_box.php'); } But the box just shows up on every page, not just index.php (which is redirected to www.mysite.com/ in this case). Any ideas? Link to comment Share on other sites More sharing options...
Guest Posted April 19, 2010 Share Posted April 19, 2010 Try this. if (basename($PHP_SELF) == FILENAME_DEFAULT) include(DIR_WS_BOXES . 'new_box.php'); Link to comment Share on other sites More sharing options...
longhorn1999 Posted April 19, 2010 Author Share Posted April 19, 2010 Try this. if (basename($PHP_SELF) == FILENAME_DEFAULT) include(DIR_WS_BOXES . 'new_box.php'); That almost works but actually the box is showing up for some reason in my category and manufacturer pages, where all products are listed. I have a URL add-on and Product Listing Enhancements installed, so I guess those pages are being considered as FILENAME_DEFAULT as well, though I would expected them to be product_listing.php instead. I'll try to experiment a bit with this code. Thanks Brian. Link to comment Share on other sites More sharing options...
Guest Posted April 20, 2010 Share Posted April 20, 2010 That almost works but actually the box is showing up for some reason in my category and manufacturer pages, where all products are listed. I have a URL add-on and Product Listing Enhancements installed, so I guess those pages are being considered as FILENAME_DEFAULT as well, though I would expected them to be product_listing.php instead. I'll try to experiment a bit with this code. Thanks Brian. It sounds like you want the box to show only on the default part of index. Not when you click a category/subcategory or select a manufacturer. If so then try this. if ((basename($PHP_SELF) == FILENAME_DEFAULT) && ($category_depth == 'top') && (!isset($_GET['manufacturers_id']))) { include(DIR_WS_BOXES . 'new_box.php'); } Link to comment Share on other sites More sharing options...
longhorn1999 Posted April 20, 2010 Author Share Posted April 20, 2010 It sounds like you want the box to show only on the default part of index. Not when you click a category/subcategory or select a manufacturer. If so then try this. if ((basename($PHP_SELF) == FILENAME_DEFAULT) && ($category_depth == 'top') && (!isset($_GET['manufacturers_id']))) { include(DIR_WS_BOXES . 'new_box.php'); } That's exactly what I was looking for and this code works perfectly. Thanks again! Link to comment Share on other sites More sharing options...
zeberrun Posted August 26, 2012 Share Posted August 26, 2012 can we do ths in 2,3,1 in template_buttom.php if ($oscTemplate->hasBlocks('boxes_column_right')) && ((basename($PHP_SELF) == FILENAME_DEFAULT) && ($category_depth == 'top') && (!isset($_GET['manufacturers_id']))) { ?> <div id="columnRight" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?>"> <div><?php echo $oscTemplate->getBlocks('boxes_column_right'); ?></div> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.