View Single Post
  #135  
Old 07-06-2006, 01:21 AM
 
kenlerch kenlerch is offline
 

Member
  
Join Date: Apr 2005
Posts: 26
 

Default Code Modified for use with DSEFU

Hey guys, I just got the code working with DSEFU's , v 4.0.17 Pro and figured it would be of use here since both seem to be a popular mod and I had seen at least one request in this thread.

Notes:
* This is the entire code for subcatecories.tpl
* Modified per Balinor's post on page 8 to use file system for images instead of a call to the database
* This code uses 4 columns. You have to set n in "div by n" to the (number of columns + 1). I also changed the width of the table to work with four columns, thus the "25%". Just change that value to the appropriate number for your number of columns (33% for 3, 20% for 5, etc).
* I used an image height of 50, so you may need to change that to your needs as well.

Thanks for this mod, it's definitely a good one. And thanks for this forum in general. I've found lots of good stuff here and figured I'd give something back with this post.

Code:
{* $Id: subcategories.tpl,v 1.43.2.2 2004/10/07 07:08:51 max Exp $ *} {if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"} {include file="modules/Bestsellers/bestsellers.tpl"} {/if} {if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description|regex_replace:"/[\n]/":" "} {/if} {capture name=dialog} {assign var="tmp" value="0"} {section name=cat_num loop=$subcategories} {if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if} {/section} {* ==================== Sub categories mod start *} {foreach from=$subcategories item=subcat name="subcats"} { if $smarty.foreach.subcats.first } <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0"> {/if} { if $smarty.foreach.subcats.iteration is div by 5} <tr> {/if} <td align="center" valign="top" width="25%"> <a href="{seo_link cat_name=$subcat.category cat_id=$subcat.categoryid}"> {if $subcat.icon_url}[img]{$subcat.icon_url}[/img]{else}[img]{$xcart_web_dir}/default_image.gif[/img]{/if} </a> <a href="{seo_link cat_name=$subcat.category cat_id=$subcat.categoryid}"> <font size="1">{$subcat.category|escape}</font></a> {if $config.Appearance.count_products eq "Y"} {if $subcat.product_count}{ $subcat.product_count } {$lng.lbl_items} {elseif $subcat.subcategory_count}{ $subcat.subcategory_count } {$lng.lbl_categories|lower} {/if} {/if} </td> { if $smarty.foreach.subcats.last } </tr> </table> {/if} {/foreach} {* ==================== Sub categories mod end *} {if $tmp and $products ne "" } <BR clear="left"> <HR size="1" 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} { 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_man} {/if} {/capture} {include file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog extra="width=100%"} {if $products eq ""} {if $f_products ne ""} {include file="customer/main/featured.tpl"} {/if} {/if} { include file="customer/main/navigation.tpl" }
__________________
Version 4.0.17 Pro
Reply With Quote