Better late than never...
To match a product category with a specific sidebar image:
I added the Blank Sidebox module (http://www.zen-cart.com/index.php?ma...roducts_id=174) and then modified the script slightly to match a portion of the URL to a specific image; specfically "Path=#", since each product has a unique Path=#.
Here's the modified tpl_blank_sidebox.php code:
PHP Code:
<?php if (stripos($_SERVER['REQUEST_URI'],'Path=3') !== false)
{$img1 = '<img src="http://www.example.com/images/image1.jpg" alt="" />';}
elseif (stripos($_SERVER['REQUEST_URI'],'Path=4') !== false)
{$img1 = '<img src="http://www.example.com/images/image2.jpg" alt="" />';}
else {$img1 = '<img src="http://www.example.com/images/image3.jpg" alt="" />';}
?>
<?php
/**
* blank sidebox - allows a blank sidebox to be added to your site
*
* @package templateSystem
* @copyright 2007 Kuroi Web Design
* @copyright Portions Copyright 2003-2007 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: blank_sidebox.php 2007-05-26 kuroi $
*/
$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
// Replace the text and HTML tags between the apostophes on lines 19 and 20.
// Use as many or as few lines using this model as you need for your custom content.
// If you have a multilingual site define your text in the languages/YOUR_LANGUAGE/extra_definitions/blank_sidebox_defines.php and include it as shown in line 19.
// If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!)
// $content .= '<p>' . TEXT_LEFT_SIDEBOX . '</p>';
$content .= $img1;
$content .= '</div>';
?>
So far this has worked great. Hope it helps someone else looking for a similar solution...
Bookmarks