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

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
SymenTimmermans
New Member
New Member
Posts: 6
Joined: Tue Oct 23, 2007 9:33 am

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

Post 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?
Last edited by SymenTimmermans on Tue Oct 23, 2007 1:48 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

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

Post by calguy1000 »

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

should be

{news category="$entry->category"}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
SymenTimmermans
New Member
New Member
Posts: 6
Joined: Tue Oct 23, 2007 9:33 am

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

Post 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!
Post Reply

Return to “CMSMS Core”