X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   sub category icon (https://forum.x-cart.com/showthread.php?t=1724)

funkydunk 05-06-2003 08:25 AM

Try this instead:

Code:

{* $Id: subcategories.tpl,v 1.29 2002/11/26 14:55:13 alfiya Exp $ *}
{ include file="location.tpl" }
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}


 
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}


 
{ include file="customer/main/navigation.tpl" }
{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}
{section name=cat_num loop=$subcategories}

{ if %cat_num.first% }
<table border=0 cellspacing=5>
{/if}

<tr>

{* new funkydunk bit *}
<td align="left">
[img]../icon.php?categoryid={$subcategories[cat_num].categoryid}[/img]
</td>
{* end of funkydunk bit *}

<td align=left nowrap width=95%>
<font class="ItemsList">{ $subcategories[cat_num].category|escape }</font>
 
</td>

<td align=right nowrap><font class=Text>
{if $subcategories[cat_num].product_count}
{ $subcategories[cat_num].product_count } {$lng.lbl_products}
{elseif $subcategories[cat_num].subcategory_count}
{ $subcategories[cat_num].subcategory_count } {$lng.lbl_categories|lower}
{/if}
</font></td>
</tr>

{*/if*}
{ if %cat_num.last% }
</table>

{/if}
{/section}
{if $tmp and $products ne "" }
<br clear=_all>{*<hr size=1 noshade>*}
{/if}
{/capture}
{include file="dialog.tpl" title=$current_category.category|regex_replace:"/.*\//":"" content=$smarty.capture.dialog extra="width=100%"}
{include file="customer/main/products.tpl" products=$products}
{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}
{if $products eq ""}
{if $f_products ne ""}


 
{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }


This will put the icons to the left of the category names

poboy 05-06-2003 06:10 PM

You're the man..
 
Funkydunk,

You are the man, I had to change the code a tiny bit, but I would have never done it with out you, I can promise you that. Here is the code that I used:
Code:

{* $Id: subcategories.tpl,v 1.29 2002/11/26 14:55:13 alfiya Exp $ *}
{ include file="location.tpl" }
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}



{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}



{ include file="customer/main/navigation.tpl" }
{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}
{section name=cat_num loop=$subcategories}
{ if %cat_num.first% }
{if $tmp} [img]../icon.php?categoryid={$cat}[/img] {/if}
<table border=0 cellspacing=5>
{/if}
{*if $subcategories[cat_num].product_count or $subcategories[cat_num].subcategory_count*}
<tr>

{* new funkydunk bit *}
<td align="left" valign="middle">
[img]{$ImagesDir}/arrow.gif?categoryid={$subcategories[cat_num].categoryid}[/img]
</td>
{* end of funkydunk bit *}

<td align=left nowrap width=95%>
<font class="ItemsList">{ $subcategories[cat_num].category|escape }</font>

</td>
<td align=right nowrap><font class=Text>
{if $subcategories[cat_num].product_count}
{ $subcategories[cat_num].product_count } {$lng.lbl_products}
{elseif $subcategories[cat_num].subcategory_count}
{ $subcategories[cat_num].subcategory_count } {$lng.lbl_categories|lower}
{/if}
</font></td>
</tr>
{*/if*}
{ if %cat_num.last% }
</table>
{/if}
{/section}
{if $tmp and $products ne "" }
<br clear=_all>{*<hr size=1 noshade>*}
{/if}
{/capture}
{include file="dialog.tpl" title=$current_category.category|regex_replace:"/.*\//":"" content=$smarty.capture.dialog extra="width=100%"}
{include file="customer/main/products.tpl" products=$products}
{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}
{if $products eq ""}
{if $f_products ne ""}



{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }


Check it out and please pass it on. I'm also pulling my icon out of the images directory and not the database. Thank you for helping, seriously.
My home address is http://www.iexweb.com

Chris
chris@iexweb.com

parzoe 06-04-2003 11:27 AM

uploaded graphic and link to cat.
 
This one shows the uploaded graphic along with a link to the category. Cheers!

Code:

{* $Id: subcategories.tpl,v 1.29 2002/11/26 14:55:13 alfiya Exp $ *}
{ include file="location.tpl" }
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}


 
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}


 
{ include file="customer/main/navigation.tpl" }
{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}
{section name=cat_num loop=$subcategories}

{ if %cat_num.first% }
<table border=0 cellspacing=5>
{/if}

<tr>

{* new funkydunk bit *}
<td align="left">
[img]../icon.php?categoryid={$subcategories[cat_num].categoryid}[/img]
</td>
{* end of funkydunk bit *}

<td align=left nowrap width=95%>
<font class="ItemsList">{ $subcategories[cat_num].category|escape }</font>
 
</td>

<td align=right nowrap><font class=Text>
{if $subcategories[cat_num].product_count}
{ $subcategories[cat_num].product_count } {$lng.lbl_products}
{elseif $subcategories[cat_num].subcategory_count}
{ $subcategories[cat_num].subcategory_count } {$lng.lbl_categories|lower}
{/if}
</font></td>
</tr>

{*/if*}
{ if %cat_num.last% }
</table>

{/if}
{/section}
{if $tmp and $products ne "" }
<br clear=_all>{*<hr size=1 noshade>*}
{/if}
{/capture}
{include file="dialog.tpl" title=$current_category.category|regex_replace:"/.*\//":"" content=$smarty.capture.dialog extra="width=100%"}
{include file="customer/main/products.tpl" products=$products}
{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}
{if $products eq ""}
{if $f_products ne ""}


 
{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }


Jim K. 06-11-2003 10:04 PM

I used the code from parzoe and it seems to work well. I am also trying to use this to display my icons in columns ( 2 or 3 columns wide) with a link below each image. I will have a category with 80 - 100 subcategories that will need to show images for each listing. Does anyone have any ideas on the code to do this?


Jim

nfc5382 11-18-2003 03:03 PM

Quote:

Originally Posted by Jim K.
I used the code from parzoe and it seems to work well. I am also trying to use this to display my icons in columns ( 2 or 3 columns wide) with a link below each image. I will have a category with 80 - 100 subcategories that will need to show images for each listing. Does anyone have any ideas on the code to do this?


Jim


i'm intrested in this as well; i've seen many examples....is there a mod somewhere?

nfc5382 11-18-2003 03:11 PM

i found this (it was a few pages back in the search!)

i'll give it a try now.....

http://forum.x-cart.com/viewtopic.php?t=5131&highlight=3+columns


All times are GMT -8. The time now is 12:47 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.