For the case of foreground image switching, this from the v3.0 readme tells how to use it:
----------------------------------------------------------------------------------------------
To switch Foreground images instead of Backgrounds:
Call the smart_backgrounds() function from any file where page-dependent coding is desired.
Include string arguments if you want to use other than '.gif' images or look for other than 'bg' files.
<?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'smartsidebox' . smart_backgrounds('.jpg','sidebox') . '.jpg', 'Your alt text');?>
will output
<img src="http://yourdomain.com/includes/templates/your_template/images/smartsidebox_page5.jpg" alt="Your alt text">
on ez-page id 5 if smartsidebox_page5.jpg exists. Combine this with an "if" statement
$smart_image = smart_backgrounds('.jpg','sidebox');
if ($smart_image == '_page5') {
echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'smartsidebox' . $smart_image . '.jpg', 'Your alt text');
}
to show the content only on ez-page id 5 if smartsidebox_page5.jpg exists.
if (substr_count($smart_image,'_page')) {
echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'smartsidebox' . $smart_image . '.jpg', 'Your alt text');
}
will show the content on any ez-page if an appropriate smartsidebox_page.jpg file exists.
Name and save images as described above.
For foreground images, you do not need to make individual stylesheet rules.
----------------------------------------------------------------------------------------------
You could usewith images like smartlogo_13_27.jpg to give a custom logo for subcategory cPath 13_27.PHP Code:<?php echo zen_image(DIR_WS_TEMPLATE_IMAGES . 'smartlogo' . smart_backgrounds('.jpg','logo') . '.jpg', 'Your alt text');?>


Reply With Quote

