I would like to set up the news section of the site with all the active categories listed vertically on the left hand side, and all individual news items on the right hand side.
What I have done so far:
1. Set up a template "news" to be used for news pages with the following contents for the body:
Code: Select all
</__body>
<div id="menu_vert">
{news browsecat='1'}
</div>
<div id="content">
<h2>{title}</h2>
{news}
{content}
</div>
<__body>
3. Created a "News" page that uses the template.
4. Within the news module, added a bunch of categories.
5. Within the news module, set up a category template with the following contents:
Code: Select all
{if $count > 0}
<ul class="list1">
{foreach from=$cats item=node}
{if $node.count > 0}
{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>
{/if}
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node.depth-1}</li>
</ul>
{/if}
6. Created a new summary template and removed everything above the line "{* if you don't want category browsing on your summary page, remove this line and everything above it *}".
What I would like to achieve:
1. When I click on a category I would like to get only news items from that category displayed on the right hand side, without the general list of news items above.
2. The same applies to when I click on the heading of a news item or its "Read more" link.
Both goals are accomplished when I remove the {news} tag within the content div from the template, but then the initial page won't show any news items.
I have already tried creating another template "newsdetails" with the following content:
Code: Select all
</__body>
<div id="menu_vert">
{news browsecat='1'}
</div>
<div id="content">
<h2>{title}</h2>
{content}
</div>
<__body>
Code: Select all
</__body>
<div id="menu_vert">
{news browsecat='1'}
</div>
<div id="content">
<h2>{title}</h2>
{news detailpage="newsdetails"}
{content}
</div>
<__body>
Am I generally going into the right direction, and would it be possible to get any pointers for achieving my goals?