View Single Post
  #2  
Old 08-13-2012, 01:41 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Category images on front page

Hi mekon. This is where we keep our code snippets! Agreed it would be nice if they were organized...

Well I mocked up some code for you. Try adding this to /common_files/customer/main/welcome.tpl
PHP Code:
{foreach from=$categories_menu_list item=category name=front_cats}

  <
span class="subcategories" style="min-width: {$subcat_div_width}px; width: {$subcat_div_width}px; min-height: {$subcat_div_height}px;">
    {if 
$category.is_icon}
      <
a href="home.php?cat={$category.categoryid}"><img src="{get_category_image_url category=$category}" alt="{$category.category|escape}width="{$category.image_x}height="{$category.image_y}/></a>
    {else}
      <
img src="{$ImagesDir}/spacer.gif" alt="" width="1" height="{$subcat_img_height}/>
    {/if}
    <
br />
    <
a href="home.php?cat={$category.categoryid}">{$category.category|escape}</a><br />
    {if 
$config.Appearance.count_products eq "Y"}
      {if 
$category.product_count}
        {
$lng.lbl_N_products|substitute:products:$category.product_count}
      {elseif 
$category.subcategory_count}
        {
$lng.lbl_N_categories|substitute:count:$category.subcategory_count}
      {/if}
    {/if}
  </
span>

{/foreach} 
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote