Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Mod for subcategories in columns with descriptions and icons

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #201  
Old 05-16-2007, 10:15 AM
 
hhiker hhiker is offline
 

eXpert
  
Join Date: May 2007
Posts: 231
 

Default Re: Mod for subcategories in columns with descriptions and icons

I have read through this thread & am a bit confused as to what code I need to use to get the sub-category thumbs to show up. I tried a few different things that were shown here but could not get it to function properly so I restored the original subcategories.tpl file to our site.

Can someone post the latest, functional code again please?
__________________
-
-
Versions: 4.1.10 and 4.3.0 (see post for which cart)

"Until man duplicates a blade of grass, nature can laugh at his so-called scientific knowledge." - Thomas Edison

"Never doubt that a small group of thoughtful, committed citizens can change the world; indeed, it is the only thing that ever has." - Margaret Mead (1901-197 quoted in John M. RIchardson, ed. Making it Happen, 1982

"Water is the best of all things." - Pindar (c. 522 BC - c. 438 BC), Olympian Odes
Reply With Quote
  #202  
Old 05-25-2007, 03:50 PM
 
pcparts pcparts is offline
 

Advanced Member
  
Join Date: Jul 2006
Location: Aussie
Posts: 85
 

Default Re: Mod for subcategories in columns with descriptions and icons

http://forum.x-cart.com/showthread.php?t=3848&page=14
mrkenzie post #137

This works with 4.1.7
__________________
Greg
X-CART Gold 4.1.10
Reply With Quote
  #203  
Old 05-26-2007, 08:40 AM
 
maineiac maineiac is offline
 

Member
  
Join Date: Jun 2005
Location: USA
Posts: 29
 

Default Re: Mod for subcategories in columns with descriptions and icons

mrkenzie post #137 does indeed work with v4.1.7. Thank you!

When checking the html output it seems that the table cells are not closed ie: <td>subcategory icon <td>subcategory icon etc. with no closing </td> tags. Anyone know where/how to fix this?

FIXED:
code: subcategories.tpl:
_________________________________________________
{if $subcategories}
<table cellspacing="5" width="100%" border="0">
<tr>
{foreach from=$subcategories item=subcat}

{if $tmp is div by 3}
</tr><tr><td colspan="3"></td></tr><tr valign="top">
{/if}

{ if $tmp and $first_subcat ne "Y" }
{assign var="tmp" value=0}
{assign var="first_subcat" value="Y"}
{/if}

<td class="ColumnTitles" valign="top"><a title="{$subcat.description}" href="home.php?cat={ $subcat.categoryid }"><font class="ItemsList">{ $subcat.category|escape }</font><br /><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_w eb_dir}/default_image.gif{/if}" alt="" />

</a></td>

{if $config.Appearance.count_products eq "Y"}
{if $subcat.product_count}{ $subcat.product_count } {$lng.lbl_products}
{elseif $subcat.subcategory_count}{ $subcat.subcategory_count } {$lng.lbl_categories|lower}
{else} 0 Products
{/if}
{/if}
{assign var="tmp" value=$tmp+1}
{/foreach}
</tr></table>
{/if}
__________________________________________________ ____
__________________
maineiac

x-cart gold v4.0.18
x-cart gold v4.1.8

Last edited by maineiac : 06-05-2007 at 05:54 AM. Reason: resolved
Reply With Quote
  #204  
Old 07-06-2007, 06:30 PM
 
jrmpling jrmpling is offline
 

Newbie
  
Join Date: Jul 2007
Posts: 3
 

Default Re: Mod for subcategories in columns with descriptions and icons

Quote:
Originally Posted by hhiker
I have read through this thread & am a bit confused as to what code I need to use to get the sub-category thumbs to show up. I tried a few different things that were shown here but could not get it to function properly so I restored the original subcategories.tpl file to our site.

Can someone post the latest, functional code again please?

the post on page 14 works (mrkenzie's, post #137 from the link above) for 4.1.8. tested. you just need to save your category icons to the filesystem and not the database. i have yet to see a working code for calling images from the database.

you can set where the images are saved thru the images location in your x-cart admin page. hope that helps.

i seem to be having an issue with the descriptions though. if i use the wysiwyg mode to type in the description it shows the html tags when you hover over the subcat title. has anyone been able to make it work with wysiwyg mode without showing the html tags?
__________________
x-cart 4.1.8
Reply With Quote
  #205  
Old 07-08-2007, 05:38 PM
 
hhiker hhiker is offline
 

eXpert
  
Join Date: May 2007
Posts: 231
 

Default Re: Mod for subcategories in columns with descriptions and icons

I actually got it working some time last week. I just have been so busy with modifying the cart & other things at work I did not get back here to post.

Thanks for the help!
__________________
-
-
Versions: 4.1.10 and 4.3.0 (see post for which cart)

"Until man duplicates a blade of grass, nature can laugh at his so-called scientific knowledge." - Thomas Edison

"Never doubt that a small group of thoughtful, committed citizens can change the world; indeed, it is the only thing that ever has." - Margaret Mead (1901-197 quoted in John M. RIchardson, ed. Making it Happen, 1982

"Water is the best of all things." - Pindar (c. 522 BC - c. 438 BC), Olympian Odes
Reply With Quote
  #206  
Old 07-30-2007, 05:37 AM
 
DavyMac DavyMac is offline
 

eXpert
  
Join Date: Apr 2007
Location: Poole, UK
Posts: 333
 

Default Re: Mod for subcategories in columns with descriptions and icons

I've implemented the code listed on page 14 of this thread and found it to be straight forward to get working. I have, however, noticed that the subcategory description alongside the image is a link (good) with the alt tag being the sub category description (also good) except it displays the <h1> and <\h1> header tags.

Can anyone point me towards where the subcategory description header is formed so that I can use it before the <h1> tags are added? ...or does anyone know how to strip leading/trailing characters from strings?
__________________
X-Cart GOLD Plus v4.5.4
CDSEO Pro
ewdhosting Dedicated Server
Dedicated SSL
Stone Edge OM
Reply With Quote
  #207  
Old 07-31-2007, 01:59 AM
 
DavyMac DavyMac is offline
 

eXpert
  
Join Date: Apr 2007
Location: Poole, UK
Posts: 333
 

Default Re: Mod for subcategories in columns with descriptions and icons

As has been the case with all my posts I shall now answer my own question:

To remove the header 1 tags from the title of the subcategory links using the code on page 14 I have used the strip_tags variable modifier as follows:

Code:
<td class="ColumnTitles" valign="top"><a title="{$subcat.description|strip_tags:false}" href="home.php?cat={ $subcat.categoryid }"><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_web_dir}/default_image.gif{/if}" alt="{$subcat.category|escape}" /><BR /> <font class="ItemsList">{ $subcat.category|escape}:</font></a>

I just love it when code does what you want it to!
__________________
X-Cart GOLD Plus v4.5.4
CDSEO Pro
ewdhosting Dedicated Server
Dedicated SSL
Stone Edge OM
Reply With Quote
  #208  
Old 08-04-2007, 01:08 PM
 
Glowinafuse Glowinafuse is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 80
 

Default Re: Mod for subcategories in columns with descriptions and icons

How do I get the code below for message 182 to be centered under image?

Please help

Jason

Quote:
Originally Posted by karentown
OK, all done and working now on version 4.0.19 as seen here:

http://www.partypresence.co.uk/store/home.php?cat=248

The subcategories code is:

Code:
{* $Id: subcategories.tpl,v 1.43.2.9 2006/06/27 08:22:01 svowl Exp $ *} {if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"} {include file="modules/Bestsellers/bestsellers.tpl"} {/if} {if $active_modules.Special_Offers and $category_offers} <BR><BR> {include file="modules/Special_Offers/customer/category_offers_short_list.tpl"} {/if} {if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}<BR><BR>{/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} {if $subcategories} <table cellspacing="5" width="100%" border="0"> <tr> {foreach from=$subcategories item=subcat} {if $tmp is div by 3} </tr><tr><td colspan="3"></td></tr><tr valign="top"> {/if} { if $tmp and $first_subcat ne "Y" } {assign var="tmp" value=0} {assign var="first_subcat" value="Y"} {/if} <td class="ColumnTitles" valign="top"><a title="{$subcat.description}" href="home.php?cat={ $subcat.categoryid }"><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_web_dir}/default_image.gif{/if}" alt="" align="middle" <br><left> <font class="ItemsList">{ $subcat.category|escape }</font></a> {if $config.Appearance.count_products eq "Y"} {/if} {assign var="tmp" value=$tmp+1} {/foreach} </table> {/if} {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} <BR> { include file="customer/main/navigation.tpl" } {/if} <BR> {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" }

Hope that helps someone! Thanks so much for the emails Robbert .... couldnt have done it without you!!!!
__________________
Gold 4.1.11
www.houseoftropicals.com/store
Reply With Quote
  #209  
Old 08-22-2007, 11:37 AM
 
ptcsstore ptcsstore is offline
 

Advanced Member
  
Join Date: May 2006
Posts: 34
 

Default Re: Mod for subcategories in columns with descriptions and icons

I have tried the code from post 137 and I see no difference. What could I be doing wrong?

I have ver 4.1.8. I made the changes to skin1.css, include/categories.php, and skin1/customer/main/subcategories.tpl. Uploaded the files, refreshed my frontpage of the store and no changes....

Thanks for the help.
__________________
Bryan Edwards
X-cart Version 4.1.3
Reply With Quote
  #210  
Old 08-31-2007, 12:36 PM
 
TL408 TL408 is offline
 

X-Adept
  
Join Date: Jan 2005
Posts: 549
 

Default Re: Mod for subcategories in columns with descriptions and icons

I can't believe it that X-Cart still hasn't fix this "problem" since several release ago.

If someone from Xcart reading this, PLEASE consider getting this added as an option on the next release!!!
__________________
Win2003 IIS6, PHP 5.2.3, MySQL 5.0.45 and X-Cart 4.1.9
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020