Hi all.
I had wanted to be able to put some stylized image text above each product listing pages (in place of the category name), and have it different for each category, but I didn't want to affect the category box, as I wanted that to stay as text.
I had not been able to find a solution for this, and so I figured one out myself.
The modification only affects the tpl_index_product_list.php file, located in the /includes/templates/YOUR_TEMPLATE/templates folder.
And you simply change the following line:
With this:Code:<h1 id="productListHeading"><?php echo $breadcrumb->last(); ?></h1>
The above stores the images in the main images directory, but that can obviously be changed to whatever you want.Code:<div align="center"> <br/> <?php $spacereplace = trim($breadcrumb->last()); $spacereplace = str_replace (" ", "_", $spacereplace); $catimagestring = "<img src=\"/menu/images/$spacereplace.gif\" />"; echo $catimagestring; ?> <br/> </div>
Essentially all it does is take the category name, replace the spaces between words (if any) with underscores, and appends the ".gif" extension and puts in an IMG tag. So you need to have an image file that is named exactly in this way so that it can find the file.
The only drawback to this method (albeit minor) is that you have a few characters that you cannot use in your category names in order for this to work correctly (i.e. / or " or . etc). Maybe there is a way to solve this too, but I am not that familiar with PHP to know what it is yet.
If you want to see it in action, check the following link? (Currently only the first 4 categories are set up with images. So click on one of them.)
http://www.bestpizzainphilly.net/menu
Hope this helps!
Chris



