Using Banner Manager for internal linking

Mark Russell <[email protected]> 18 Aug 2003 14:34:34 -0000
Newsgroups gmane.comp.web.oscommerce.tips
Message-ID <2e7c790084a105b64fb4d014549b5a1f@osCommerce-Forums>
This message was sent from: Tips and Tricks
http://forums.oscommerce.com/viewtopic.php?p=215783#215783
----------------------------------------------------------------

My wife needed a means of easily entering and managing cross links/promotions on her site. For example, if the customer is on a page for tights size 0-6 months, she wants to place a banner/link on that category page cross linking to socks size 0-6 months.  Etc.

I could have done it with html in the category description, but turning the links on/off and editing them seemed like it would be an pain.

I worked up the following simple solution using the Banner Manager.  She wanted the solution in the right column, so within column_right.php I put the following banner code from footer.php.

[code]<?php
  if ($banner = tep_banner_exists('dynamic', $cPath)) {
?>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><?php echo tep_display_banner('static', $banner); ?></td>
  </tr>
</table>
<?php  
}
?>[/code]

I replaced the hard-coded reference to Group name (468x50) with the variable $cPath.  I then give the banner that I want displayed on a page a Group name that matches the $cPath for that page.  For example, tights size 0-6 months is $cPath 21_33 which is the group name I create.  The click URL for the link is the page to which you want the link to go to.  I also removed target="_blank" from functions/banner.php so the click through renders in the same window.  

This is a pretty simple yet elegant solution because it allows the use of the built-in Banner Manager functionality making it easy to manage through admin.

Hope others find this useful.

Mark