Hello to everybody,
How can I show in the news detail page a link to the category related to the news ? In this way I would like to show, when clicking the category link, all the news related to selected category.
Sorry for my english.
Thanks.
[SOLVED] Link category in the news detail page.
[SOLVED] Link category in the news detail page.
Last edited by FAB on Sat Dec 05, 2009 9:15 am, edited 1 time in total.
Re: Link category in the news detail page.
1. Create page that will show news of appropriate category. Lets call it "test". Category is taken from $_GET variable member "news_category".
2. In news detail template create link to "test" page with additional parameter "news_category"
Code: Select all
{news category=$smarty.get.news_category detailpage="pagealias"}
Code: Select all
{capture assign='urlparam'}&news_category={$entry->category}{/capture}
{cms_selflink page='test' urlparam=$urlparam text=$entry->category}
Re: Link category in the news detail page.
Compliments !!

Works fine !
THANK YOU


Works fine !
THANK YOU
Re: [SOLVED] Link category in the news detail page.
Hi,
Is there also a way to do this with pretty url's? Meaning that somehow the following code can be set in de detail page template.
Thank you,
Rick
Is there also a way to do this with pretty url's? Meaning that somehow the following code can be set in de detail page template.
Code: Select all
{foreach from=$categories item='one'}
<li><a href="{$one.url}" title="{$one.name}">{$one.name}</a> ({$one.count})</li>
{/foreach}
Thank you,
Rick
Re: [SOLVED] Link category in the news detail page.
With pretty ur's you can use the following on your summary page.
- Rick
Code: Select all
{if $entry->categories}
<div class="CGBlogSummaryCategory">
{strip}
{foreach from=$entry->categories item='one_category'}
{foreach from=$categories item='one'}
{if $one_category.name == $one.name}
<a href="{$one.url}" title="{$one.name}">{$one.name}</a>
{/if}
{/foreach}
{/foreach}
{/strip}
</div>
{/if}
Re: [SOLVED] Link category in the news detail page.
That's for CGblog, do you have the one for news? Thanks!