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.


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

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

Showing news on homepage


2 Posts   1567 Views


31 July 2007 at 5:40am 4 Posts

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?


31 July 2007 at 9:06am Community Member, 94 Posts

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