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)
-   -   Getting subcategory descriptions to display (https://forum.x-cart.com/showthread.php?t=55214)

keress@lkcwebdesign.com 08-23-2010 11:08 AM

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>


cflsystems 08-23-2010 02:19 PM

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}

keress@lkcwebdesign.com 08-23-2010 04:59 PM

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?

cflsystems 08-23-2010 06:14 PM

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


All times are GMT -8. The time now is 01:32 AM.

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