[SOLVED] Latest news from specific category

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
urheat
Forum Members
Forum Members
Posts: 243
Joined: Sat Oct 17, 2009 6:50 am

[SOLVED] Latest news from specific category

Post by urheat »

The site has two news categories. I need to show the latest news in detail view from specific category. To be more specific: only one news from general-category.

I tried this:

Code: Select all

{news action="detail" articleid="-1" category="General"}
But category-attribute is ignored.

Can this be done?

CMSMS is 1.10. and news is 2.12.2.
Last edited by urheat on Sat Oct 29, 2011 10:07 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Latest news from specific category

Post by Dr.CSS »

Why are you using the articleid="-1" and not the number='1' parameter?...
urheat
Forum Members
Forum Members
Posts: 243
Joined: Sat Oct 17, 2009 6:50 am

Re: Latest news from specific category

Post by urheat »

Dr.CSS wrote:Why are you using the articleid="-1" and not the number='1' parameter?...
Maybe I'm missing something, but do you mean like this:

Code: Select all

{news number="1" category="General"}
It works, but I need it to be in "detail-mode". This shows the news in shortened summary-mode. I also tried to add action="detail", but it didn't work.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Latest news from specific category

Post by RonnyK »

correct.... The articleid=-1, will only work icw action=detail and doesnt take category in account. To use that, make a summary-template similar as the detailtemplate and call that summarytemplate with the number= parameter. That way you get the last entry from a specific category in the look that you want.

Ronny
urheat
Forum Members
Forum Members
Posts: 243
Joined: Sat Oct 17, 2009 6:50 am

Re: Latest news from specific category

Post by urheat »

RonnyK wrote:correct.... The articleid=-1, will only work icw action=detail and doesnt take category in account. To use that, make a summary-template similar as the detailtemplate and call that summarytemplate with the number= parameter. That way you get the last entry from a specific category in the look that you want.

Ronny
Thanks! That can be done :)

Maybe action=detail could take category-attribute in account in future news-module releases... It would be more logical I think.
Post Reply

Return to “CMSMS Core”