1770 Posts in 495 Topics by 531 members
Blog Module
SilverStripe Forums » Blog Module » RSSFeed: Can you subscribe to Children OF Children?
Discuss the Blog Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 757 Views |
-
RSSFeed: Can you subscribe to Children OF Children?

6 October 2009 at 2:44am
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 -
Re: RSSFeed: Can you subscribe to Children OF Children?

13 October 2009 at 2:38am
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.
-
Re: RSSFeed: Can you subscribe to Children OF Children?

13 October 2009 at 3:04am
That's a really good idea-- thanks @dio5! I will do exactly that.
//Garrett
| 757 Views | ||
|
Page:
1
|
Go to Top |


