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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Showing latest news across ALL ArticleHolders


Reply


4 Posts   922 Views

Avatar
headless_pnub

Community Member, 17 Posts

30 January 2009 at 3:32am

Hi all,
I have a number of different pages on my site and inside each section they have there own article holder and articles. Thanks to some searching around the archived forum I've been able to display the articles for each section on their pages, but I would now like to have an overall news feed with displays the latest 5 stories taken from across all the news to go on the homepage.

Is this possible and would anybody be able to give me an idea of how to do it.

Thanks very much in advance,

Pnub

Avatar
UncleCheese

Forum Moderator, 4092 Posts

30 January 2009 at 6:25am

function AllNews()
{
return DataObject::get("NewsArticle",null, "Date ASC", null, 5)
}

Avatar
headless_pnub

Community Member, 17 Posts

30 January 2009 at 6:36am

Thanks so much.
Seems so obvious now you've written it down. I just don't select the ArticleHolder.

Thanks also for the speedy response, just getting to grips with SilverStripe and the forums are such a useful source of information.

Avatar
headless_pnub

Community Member, 17 Posts

24 February 2009 at 6:50am

Hi.

Thanks for you help before.
Is it possible to create an RSS link for all news. The tutorial works, but only when you are on an article holder and just for that holder only.