Hi,
I've got some data objects in my CMS, that is, tables constructed using the DataObjectManager rather than pages, but I'd still like to use the RSSFeed class with them so that people can subscribe to these particular items. I thought all I had to do with RSSFeed was to pass in any DataObjectSet to make this work, i.e.: it didn't have to be Page objects. And I still think this is *theoretically* true-- the problem is that the RSSFeed constructor appears to be looking for specific fields, eg. "Title" and "Content".
What if the fields in the table whose rows I am retrieving in the DataObjectSet I'm passing in do not match these names? Eg., "AnalystTitle", and "AnalystDescription"? And the main problem is the Link() issue. This DataObject does not HAVE a SilverStripe Link value-- it has a link to a FILE, a PDF, called "AnalystURL".
How can I make this work? Seems like it should be totally possible, at least by cloning the RSSFeed class and adding the ability to pass in custom-named fields to be retrieved, but I tried this and it didn't work. Here's my RSSFeed call in my summary page where the RSS link is:
function init() {
RSSFeed::linkToFeed($this->Link() . "rss");
parent::init();
}
function rss() {
$rss = new RSSFeed(Page_Controller::Analysts(), Page_Controller::Analysts()->AnalystURL, "REDACTED > ".$this->Title);
$rss->outputToBrowser();
}
...where Analysts() returns a DataObjectSet containing all the fields I mentioned above.
Then, again theoretically, in my RSSFeedDOM class, the constructor would look something like this:
function __construct(DataObjectSet $entries, $link, $title,
$description = null, $titleField = "AnalystTitle",
$descriptionField = "AnalystDescription", $authorField = null,
$lastModified = null, $etag = null) {
Can anyone help me get this working? I think adding this functionality would be a huge improvement to SilverStripe. Why can I only subscribe to Pages? I just want to get the Title and associated file link from an alternate object. I should be able to.
Thanks in advance,
Garrett