Jump to:

22977 Posts in 11742 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Showing latest news across ALL ArticleHolders

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

Page: 1
Go to End
Author Topic: 854 Views
  • headless_pnub
    Avatar
    Community Member
    17 Posts

    Showing latest news across ALL ArticleHolders Link to this post

    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

  • UncleCheese
    Avatar
    4085 Posts

    Re: Showing latest news across ALL ArticleHolders Link to this post

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

  • headless_pnub
    Avatar
    Community Member
    17 Posts

    Re: Showing latest news across ALL ArticleHolders Link to this post

    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.

  • headless_pnub
    Avatar
    Community Member
    17 Posts

    Re: Showing latest news across ALL ArticleHolders Link to this post

    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.

    854 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.