A refinement of the code to account for the home page where there is not a cPath:
PHP Code:
<?php //Smart Backgrounds
$smart_image = '';
if (($current_page_base == 'index' and $_GET[cPath] != 0) or $current_page_base == 'product_info') { //add _ and top cat id to js filename
$smart_image = '_' . (int)$_GET[cPath];
} // /Smart Backgrounds?>
<script src="http://zencart-demo-store2.littleolemedesigns.net/includes/templates/Romance_Divine_Custom/jscript/Header_Animation<?php echo $smart_image;?>.js"></script>
This will allow the home page to have the basic filename without added _0.
Bookmarks