Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

putting a box in right column on just the home page


longhorn1999

Recommended Posts

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

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

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

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

  • 2 years later...

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...