I wonder if anyone can help me with a little thing I am trying to do for part of a website I have created which I am now extending. Basically, instead of using a menu of pages, I would like to create a menu from news articles and categories for example:
Category 1
News Article 1
News Article 2
News Article 3
Category 2
News Article 4
News Article 5
News Article 6
Category 3
News Article 7
News Article 8
News Article 9
At the moment, I have tried to add the summary template to the browse category template wit no success as I am getting the same articles appear within each of the categories, for example:
Category 1
News Article 1
News Article 2
News Article 3
Category 2
News Article 1
News Article 2
News Article 3
Here is the code I have been using:
Code: Select all
{if $count > 0}
<ul class="list1">
{foreach from=$cats item=node}
{if $node.depth > $node.prevdepth}
{repeat string="<ul>" times=$node.depth-$node.prevdepth}
{elseif $node.depth < $node.prevdepth}
{repeat string="</li></ul>" times=$node.prevdepth-$node.depth}
</li>
{elseif $node.index > 0}</li>
{/if}
<li class="newscategory">
{if $node.count > 0}
<a href="{$node.url}">{$node.news_category_name}</a>
<!-- Start News Display Template -->
{foreach from=$items item=entry}
<div class="NewsSummary">
<div class="NewsSummaryLink">
<a href="{$entry->moreurl}" title="{$entry->title|cms_escape:htmlall}">{$entry->title|cms_escape}</a>
</div>
</div>
{/foreach}
<!-- End News Display Template -->
{else}<span>{$node.news_category_name} (0)</span>{/if}
{/foreach}
{repeat string="</li></ul>" times=$node.depth-1}</li>
</ul>
{/if}
Thanks.
Mark