Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Showing news on homepage


Reply


2 Posts   1619 Views

Avatar
abelcreative

4 Posts

31 July 2007 at 5:40am

I have a little box that shows the news clips on the hompage - however, I don't want it to show more than 3 at a time - is there a way to do that?

Avatar
xmedeko

Community Member, 94 Posts

31 July 2007 at 9:06am

look at DataObject::get() method, there's a limit parameter, so you do something like
[code php]
function GetLatest3News() {
return DataObject::get('NewsArticleClass',$filter,....,$limit=3);
}

and in the template just $GetLatest3News