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

Subcategires Not Displaying Correctly

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-24-2007, 05:23 AM
 
rashriaz rashriaz is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 72
 

Default Subcategires Not Displaying Correctly

Hi

Could anyone help me please, my subcategories are displaying an image with them but for some reason the first line always has more subcategories displaying than the others. PLease see pic for more detail.

This is my code for subcategories.tpl

Code:
{* $Id: subcategories.tpl,v 1.43.2.9 2006/06/27 08:22:01 svowl Exp $ *} {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="6" 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" align="middle"><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> <p><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" }
Attached Thumbnails
Click image for larger version

Name:	cats.gif
Views:	189
Size:	26.5 KB
ID:	703  
__________________
rashriaz
product -x-cart gold 4.1.9
operating system -windows
location - uk
Reply With Quote
  #2  
Old 12-26-2007, 12:34 AM
 
rashriaz rashriaz is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 72
 

Default Re: Subcategires Not Displaying Correctly

Anyone got any ideas please?
__________________
rashriaz
product -x-cart gold 4.1.9
operating system -windows
location - uk
Reply With Quote
  #3  
Old 12-26-2007, 04:08 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Subcategires Not Displaying Correctly

You have an older version of the subcategories.tpl file than any I have - I started with XCART 4.1.8 - so if you really have a 4.1.9 xcart, you may want to upgrade the subcategories.tpl file and start with that one.

--edited -- I removed a suggestion that I had here because it may have been misleading ---

I just realized that this is really a question about the "subcategories in columns mod" - If I were you I would start with the subcategories.tpl file for 4.1.9 & make the mods to that file rather than use the old version that you displayed above
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #4  
Old 12-29-2007, 11:54 AM
 
MoonDog MoonDog is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 93
 

Default Re: Subcategires Not Displaying Correctly

rashriaz,

Try this:

Find these lines of code:
Code:
{ if $tmp and $first_subcat ne "Y" } {assign var="tmp" value=0} {assign var="first_subcat" value="Y"} {/if}
and change the "tmp" value from 0 to 1, so it looks like this:

Code:
{ if $tmp and $first_subcat ne "Y" } {assign var="tmp" value=1} {assign var="first_subcat" value="Y"} {/if}
Hope it works.

- MoonDog -
__________________
X-CART Gold v4.1.8
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 10:39 AM.

   

 
X-Cart forums © 2001-2020