View Single Post
  #1  
Old 08-10-2012, 06:30 AM
 
mekon mekon is offline
 

Senior Member
  
Join Date: Jan 2011
Posts: 180
 

Default Category images on front page

Hello, ive been searching for a long time on this and I can't believe its not a standard thing in xcart.
Ive looked at older post which give me some code but not of them work.

All I want to do is show a list (which would be blocks, divs etc) of all my main categories. I need it to show the category image and it to link to the category when clicked on...like this basically: http://www.knight-air.co.uk/

I know this bit of code display the subcategories, but how can I change it to use on the home page to display the root categories

Code:
{foreach from=$categories item=subcategory} <a href="home.php?cat={$subcategory.categoryid}"><img src="{get_category_image_url category=$subcategory}" alt="{$subcategory.category|escape}" width="{$subcategory.image_x}" height="{$subcategory.image_y}" /></a> <br /> <a href="home.php?cat={$subcategory.categoryid}">{$subcategory.category|escape}</a><br /> {/foreach}



It would be a great idea if there was a knowledge base of snippets of code then people could use it as a reference.


Thanks in advance.
__________________
------------------------------------------------

Darren
Reply With Quote