Jump to:

1835 Posts in 1139 Topics by 554 members

Blog Module

SilverStripe Forums » Blog Module » RSSFeed: Can you subscribe to Children OF Children?

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 833 Views
  • Garrett
    Avatar
    Community Member
    245 Posts

    RSSFeed: Can you subscribe to Children OF Children? Link to this post

    Hi,

    I've got a Newsroom which has several content types, i.e.: Press Releases, the Blog, Events, etc. I'd like to offer an RSS feed on this parent level, but I noticed that the RSS Feed class constructor only takes $this->Children as a parameter. I'd like it to build the XML going another level down if possible. I tried passing in:

    $rss = new RSSFeed($this->Children()->Children, $this->Link(), "Newsroom");

    But alas it does not appear that Children() can be called recursively. Can anyone suggest a way to do this?

    Thanks in advance,
    Garrett

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: RSSFeed: Can you subscribe to Children OF Children? Link to this post

    The first argument for the RSSFeed method needs a DataObjectSet, like you could get with Children(). Calling Children() on that does not make much sense I think, because you can call that only on one item, not on an entire set.

    Not sure what you're trying to achieve: you want multiple rss feeds or one that combines all of them?

    If you want 'all' of them in one, you could just do a DataObject::get("YourPageType", "WHERE", "SORTBY") and take that as the argument for the RSSFeed method.

    Hope this makes some sense.

  • Garrett
    Avatar
    Community Member
    245 Posts

    Re: RSSFeed: Can you subscribe to Children OF Children? Link to this post

    That's a really good idea-- thanks @dio5! I will do exactly that.

    //Garrett

    833 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.