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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

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

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

Showing news on homepage


Go to End


2 Posts   1916 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