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.

Archive /

Our old forums are still available as a read-only archive.

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

Blog module -- RSS widget isn't grabbing articles by date


Reply


2 Posts   1759 Views

Avatar
iandouglas736

Community Member, 8 Posts

12 January 2008 at 7:07pm

So my biggest annoyance right now is that adding a new BlogEntry item adds it way down at the bottom of my list, so using the "drag-to-move" feature never gets used by me.

Unfortunately though, it seems the list's sort order is used by the RSS widget, and pulls articles based on the 'Sort' field in the SiteTree table, which seems kinda backwards -- RSS feeds are generally date-based, and it should be grabbing the newest articles based on the date.

Anyone have any idea on how to hack the RSSWidget.php code to pull the data based on the date instead of the 'sort' field?

Avatar
iandouglas736

Community Member, 8 Posts

12 January 2008 at 7:53pm

After chatting with simon_w in IRC, he figured out the fix:

modify /blog/code/BlogHolder.php
change the rss() function, around line 186, from this:

function rss() {
global $project;
$rss = new RSSFeed($this->Children(), $this->Link(), $project . " blog", "", "Title", "ParsedContent");
$rss->outputToBrowser();
}

to this:

function rss() {
global $project;
$children = $this->Children();
$children->sort('Date', 'DESC');
$rss = new RSSFeed($children, $this->Link(), $project . " blog", "", "Title", "ParsedContent");
$rss->outputToBrowser();
}

Thanks, simon_w !!