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

Getting subcategory descriptions to display

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-23-2010, 11:08 AM
 
keress@lkcwebdesign.com keress@lkcwebdesign.com is offline
 

Newbie
  
Join Date: Aug 2010
Posts: 5
 

Default Getting subcategory descriptions to display

For 4.3.2 how do I get the subcategory descriptions to display as on this page:

http://www.berryhilldrip.com/CategoryProductList.jsp?cat=Garden+and+Home+Irriga tion

I found an answer here on the forums to this question, but it seems to be for a different version and was calling for different files than I seem to be using.

I've found skin1/customer/main/subcategories_t.tpl that seems to be controlling the page displaying a category and all its subcategories. Here's the section of code I need to edit:

Code:
<span class="subcategories" style="min-width: {$subcat_div_width}px; width: {$subcat_div_width}px; min-height: {$subcat_div_height}px;"> {if $subcategory.is_icon} <a href="home.php?cat={$subcategory.categoryid}"><img src="{$subcategory.icon_url|amp}" alt="{$subcategory.category|escape}" width="{$subcategory.image_x}" height="{$subcategory.image_y}" /></a> {else} <img src="{$ImagesDir}/spacer.gif" alt="" width="1" height="{$subcat_img_height}" /> {/if} <br /> <a href="home.php?cat={$subcategory.categoryid}">{$subcategory.category|escape}</a><br /> <!-- NEED SOMETHING HERE TO CALL IN THE SUBCATEGORY DESCRIPTION --> <div class="subcategory-descr"> { {if $config.Appearance.count_products eq "Y"} {if $subcategory.product_count} {$lng.lbl_N_products|substitute:products:$subcategory.product_count} {elseif $subcategory.subcategory_count} {$lng.lbl_N_categories|substitute:count:$subcategory.subcategory_count} {/if} {/if} </span>
__________________
x-cart 4.3.2
Easy Variant View
Reply With Quote
  #2  
Old 08-23-2010, 02:19 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Getting subcategory descriptions to display

subcategories_t.tpl doesn't have description included by default, you have to call it yourself. subcategories_list.tpl has it.
{$subcategory.descr} or {$subcategory.description}
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 08-23-2010, 04:59 PM
 
keress@lkcwebdesign.com keress@lkcwebdesign.com is offline
 

Newbie
  
Join Date: Aug 2010
Posts: 5
 

Default Re: Getting subcategory descriptions to display

Thanks so much for responding. I had my settings set to display the subcategories in column view, which calls in the subcategories_t.tpl. If that's not selected, then the subcategories_list.tpl is called in, which is what I wanted, so thanks for causing me to notice that.

But, my subcategories_list.tpl doesn't have that {$subcategory.descr} or {$subcategory.description} code, and adding it, nothing happens. I tried a few more variations, {$subcat.descr} and {$subcategory.descr} and nothing appeared.

The complete line I'm adding is:

Code:
<div class="subcategory-descr">{$subcat.description}</div>

and in source view I can see the

Code:
<div class="subcategory-descr"> </div>

added, but the variable part is empty, so it's not making sense of that. Is there somewhere that variable has to be defined?
__________________
x-cart 4.3.2
Easy Variant View
Reply With Quote
  #4  
Old 08-23-2010, 06:14 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Getting subcategory descriptions to display

My bad, it is not included by default. It may even not be included in subcat array. If that's the case you will have to edit include/categories.php to include description in the categories arrays so you can call it in the template
__________________
Steve Stoyanov
CFLSystems.com
Web Development
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 06:04 AM.

   

 
X-Cart forums © 2001-2020