Page 1 of 1

[SOLVED] Display news items from same category on news detail page?

Posted: Tue Oct 23, 2007 9:52 am
by SymenTimmermans
Hello there,

I'm busy porting a newsportal which I made in Prado to CMSMS. I discovered that most of the things the client wanted are standard (or modules) in CMSMS. One thing that I can do with prado, and didn't work for me yet in CMSMS is to show news items from the same category on the news detail page.

Example:

http://connectionivoirienne.net/main/index.php?page=posts.Read&post_id=1147


I've tried this code:

Code: Select all

<table width="100%"><tr><td valign="top" width="650px;">
<h3 id="NewsPostDetailTitle">{$entry->title}</h3>
<p>Placé le {$entry->formatpostdate} - journal: ... <br />
{$category_label} {$entry->category}</p>

<div class="NewsContent">
    <div style="float: right;"><img src="{$entry->big_img_url}" style="margin-left: 10px;"></div>
    {eval var=$entry->content}
    <br clear="both" />
    <br clear="all" />
</div>

{$entry->printlink}
{if $return_url != ""}
| {$return_url}
{/if}

<td></td></td><td valign="top">
    <p><small>Plus d'infos dans cette catégorie:</small></p>
{news category="{$entry->category}"}
</td></tr></table>
    
<br />
<br />
Check that result here:

http://cms.connectionivoirienne.net/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=267&cntnt01returnid=15

What am I doing wrong here?

Re: Display news items from same category on news detail page?

Posted: Tue Oct 23, 2007 12:53 pm
by calguy1000
{news category="{$entry->category}"}

should be

{news category="$entry->category"}

Re: Display news items from same category on news detail page?

Posted: Tue Oct 23, 2007 1:48 pm
by SymenTimmermans
Thanks Calguy,

Your solution was not quite exactly what made it work, but you put me in the right direction.

I had to do this:

Code: Select all

{news category=$entry->category}
And it works now!