Category Descriptions with PLPLD 2.x

Discussion in 'Directories' started by bschneider5, Dec 30, 2006.

  1. #1
    I'm sure there's an easy way to do it, maybe I'm overlooking it. How do you display the category descriptions on the main directory page with the categories?

    I would think you would be able to toggle it on and off, otherwise why give the option of even having a description?

    If I need to hard code this, please help me out with what code I would need to add.

    Iff needed, here is the code for the index template where the categories live.
    
          <table border="0" cellpadding="0" cellspacing="2">
          <tr>
             {foreach from=$categs item=cat name=categs}
             {if ($smarty.foreach.categs.iteration mod $cats_per_col eq 1 and $cats_per_col gt 1) or $smarty.foreach.categs.first}<td>{/if}
             <h2><a href="{if $smarty.const.ENABLE_REWRITE}{$cat.TITLE_URL|escape}/{else}index.php?c={$cat.ID}{/if}">{$cat.TITLE|escape}</a>{if $smarty.const.CATS_COUNT} <span class="count">({$cat.COUNT})</span>{/if}</h2>
    
             {* Display subcategories *}
             {if !empty($cat.SUBCATS)}
             <p class="subcats">
                {foreach from=$cat.SUBCATS item=scat name=scategs}
                   <a href="{if $smarty.const.ENABLE_REWRITE}{$cat.TITLE_URL|escape}/{$scat.TITLE_URL|escape}/{else}index.php?c={$scat.ID}{/if}">
                {$scat.TITLE|escape}</a>, {/foreach} ...
             </p>
             {/if}
             {if ($smarty.foreach.categs.iteration mod $cats_per_col eq 0 and $cats_per_col gt 1) or $smarty.foreach.categs.last}</td>{/if}
             {/foreach}
          </tr>
          </table>
    Code (markup):
     
    bschneider5, Dec 30, 2006 IP
  2. bschneider5

    bschneider5 Active Member

    Messages:
    1,009
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    88
    #2
    Never mind, I found it!
     
    bschneider5, Dec 30, 2006 IP
  3. an0n

    an0n Prominent Member

    Messages:
    5,688
    Likes Received:
    915
    Best Answers:
    0
    Trophy Points:
    360
    #3
    <h2><a href="{if $smarty.const.ENABLE_REWRITE}{$cat.TITLE_URL|escape}/{else}index.php?c={$cat.ID}{/if}">{$cat.TITLE|escape}</a>{if $smarty.const.CATS_COUNT} <span class="count">({$cat.COUNT})</span>{/if}</h2>
    {$cat.DESCRIPTION|escape|trim}



    granted you first need to write your descriptions for them to show :)

    Rob
     
    an0n, Dec 30, 2006 IP