Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Different column_right for default compared to rest of site?


JenRed

Recommended Posts

Is it possible to have a different column_right for default.php than for the rest of the site?

 

My column_right shows 3 random products and my default shows 9 random products in the main body and I think it may be overkill for that first page.

 

So what I want to do is have a second column_right just for default.php with eg. a welcome message replacing the 3 random products.

 

I got it all set up and working (made a copy and called it column_right2.php and then called it in default.php) but the thing I didn't think of is that default.php is used in other places - eg. when clicking on a subcategory it uses this url:

 

http://www.redinstead.com.au/default.php?cPath=25

 

which means that the column_right2.php won't be restricted to the first page only.

 

Does this make sense??? Any ideas how I can restrict it to just the very first page of the site?

 

thanks

 

Jen

I haven't lost my mind - I have it backed up on disk somewhere.

Link to comment
Share on other sites

<!-- body_text_eof //-->

<?php 

  if ($category_depth == 'top') {

  ?>

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right2.php'); ?>

<!-- right_navigation_eof //-->

   </table></td> 

<?php 

} 

?> 

 </tr>

</table>

<!-- body_eof //-->

Link to comment
Share on other sites

Sorry... I only answered your second question.... am a bit busy to think about the first just at this moment.... let your first just sit with me for a bit :shock: ... definitely possible!

Link to comment
Share on other sites

Thanks but I think you misunderstood -

 

I got it all set up and working (made a copy and called it column_right2.php and then called it in default.php) but the thing I didn't think of is that default.php is used in other places - eg. when clicking on a subcategory it uses this url:  

 

http://www.redinstead.com.au/default.php?cPath=25

 

In other words, I know how to display a different column_right but I don't know how to make it only show up on the first page of the site, but not on things like subcategories which also use default.php for their listings.

 

Jen

I haven't lost my mind - I have it backed up on disk somewhere.

Link to comment
Share on other sites

My first code would only show it on the default page... however, I thing this is what you want... like I said, taking into account your first question...

 

<!-- body_text_eof //-->

<?php 

  if ($category_depth == 'top') {

  ?>

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php include(DIR_WS_INCLUDES . 'column_right2.php');

 } else { ?>

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">    

<?php include(DIR_WS_INCLUDES . 'column_right.php');

  }

?>

<!-- right_navigation_eof //-->

   </table></td> 



 </tr>

</table>

<!-- body_eof //-->

Link to comment
Share on other sites

ahhhh you're very clever! :)

 

I just tried your second code and it worked!

 

I'm sorry about before, I didn't see the

 

<?php 

  if ($category_depth == 'top') { 

  ?>

 

 

bit at the start of the code. I must have read it in a hurry.

 

Anyhow thanks again Matt

 

Jen

I haven't lost my mind - I have it backed up on disk somewhere.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...