网络营销电子商务研究中心

网络营销电子商务研究中心 (https://www.0058.net/index.php)
-   Web Directory (https://www.0058.net/forumdisplay.php?f=60)
-   -   Category descriptions (phpld) (https://www.0058.net/showthread.php?t=2547)

topvip 2007-07-10 02:00 AM

Category descriptions (phpld)
 
I was wondering how to include the category descriptions below the categories and sub-categories. For my site at: http://directorylist.info , I tried editing the main.tpl, adding {description} at the end of the category string line. It shows correctly on the homepage, but when clicking on a category that contains sub-categories, the main category description shows below each of the sub-categories instead of the actual sub-category description.

After:
{if ($smarty.foreach.categs.iteration mod $cats_per_col eq 1 and $cats_per_col gt 1) or $smarty.foreach.categs.first}<td valign="top" width="33%">{/if}

What I wrote was:
<h3>{$cat.TITLE|escape}{if $smarty.const.CATS_COUNT} <span class="count">({$cat.COUNT})</span>{/if}
</h3>{description}

I assume that the first bit of code is what needs to be changed so that the correct description shows for each category and sub-category, but I am not sure what to change.

I think it would be useful to show not just the category links, but their descriptions as well.

Anyone? p.s. I deleted the {description} line from my current code since it wasn't working properly.

topvip 2007-07-10 02:04 AM

see where he has {description} ?

change that to {$cat.DESCRIPTION} that should work fine.

now, if you ONLY want it on the front page then use this:
{if $category.ID eq 0 and !$list and !$search}{$cat.DESCRIPTION}{/if}


All times are GMT +8. The time now is 07:48 PM.

Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.