View Single Post
  #12  
Old 05-04-2010, 10:22 PM
 
pia pia is offline
 

Newbie
  
Join Date: Oct 2009
Posts: 6
 

Default Re: Subcategory Icon

No problem,

In customer/main/subcategories.tpl I have the following:

Code:
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu ne "Y"} <p /> {include file="modules/Bestsellers/bestsellers.tpl"} {/if} <p /> {if $active_modules.Special_Offers} {include file="modules/Special_Offers/customer/category_offers_short_list.tpl"} {/if} {if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}<p />{/if} {capture name=dialog} {assign var="tmp" value="0"} {foreach from=$subcategories item=c key=catid} {if $c.category}{assign var="tmp" value="1"}{/if} {/foreach} {if $subcategories} <table width="100%"> {assign var="count_per_row" value=3} {math equation="floor(100/x)" x=$count_per_row assign="width"} {assign var="count" value=0} {foreach from=$subcategories item=c key=catid} {if $count is div by $count_per_row} <tr> {assign var="count" value=0} {/if} <td align=center valign=top> <div class="subcatrow"> <table border=0 class="subcatstyle" cellspacing="0"> <tr> <td align="center" valign="top" ><a href="home.php?cat={$catid}" class="VertMenuItems"> {if $c.icon_url ne ""}<img src="{$c.icon_url}" width=120> {else} <img src="image.php?type=C&id=0&ts=" width=105> {/if}</a></td> </tr> <tr> <td align="center"><font class="CategoriesList"><a href="home.php?cat={$catid}" class="VertMenuItems">{$c.category}</a></font></td> </tr> {*<tr> <td align=center>{$c.description}</td> <tr>*} </table> </div> </td> {capture name=prod_index} {math equation="index+x+1" index=$count x=$count_per_row} {/capture} {if $smarty.capture.prod_index is div by $count_per_row} </tr> {/if} {math equation="x+1" x=$count assign="count" } {/foreach} {if $count lt $count_per_row} {section name=rest_cells loop=$count_per_row start=$count} <td class="SectionBox">&nbsp;</td> {/section} {/if} </tr> </table> {/if} {if $tmp and $products ne "" } <br clear="left" /> <hr size="1" noshade="noshade" /> {/if} {if $products} {if $sort_fields} <div align="right">{include file="main/search_sort_by.tpl" sort_fields=$sort_fields selected=$search_prefilled.sort_field direction=$search_prefilled.sort_direction url="home.php?cat=`$cat`&"}</div> {/if} {if $total_pages gt 2} <br /> { include file="customer/main/navigation.tpl" } {/if} <hr size="1" width="100%" /> {include file="customer/main/products.tpl" products=$products} {/if} {if $products eq "" and $tmp eq "0"} {$lng.txt_no_products_in_cat} {/if} {/capture} {include file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog extra='width="100%"'} {if $products eq ""} {if $f_products ne ""} <p /> {include file="customer/main/featured.tpl"} {/if} {/if} { include file="customer/main/navigation.tpl" }

Then, in your skin1/main.css I have the following style code that you can change and add to as fits your design:

[code]/* pia's subcat styles */
table.subcatstyle {
width: 150px; margin-right: 30px; margin-bottom: 10px;
}

.subcatrow {
height: 175px;
border: 1px solid #cccccc;
text-align: center;
padding-left: 15px;
vertical-align: middle;
}
/* end subcatstyles */

You can see what it looks like in the screen shot:Click image for larger version

Name:	lsbs-subcats-screenshot.jpg
Views:	202
Size:	86.8 KB
ID:	1934

I hope that helps

oh and ps... the sub cat image works for my css if its no bigger than 150 x 150 ish
__________________
---
pia

x-cart 4.3.1
Reply With Quote