Is there a way to have the PubDate of RSSfeed displayed using mod_feed? If there isn't a way to do this, are there any extensions that can?
Asked
Active
Viewed 442 times
2 Answers
1
The core module doesn't show it, but the data would be there and could be shown using a template override. Read more about how overrides work in Joomla here: http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
Now getting the date is a bit tricky since it's not stored plain as a PubDate property. It is instead stored as a JDate object. You can access the date property of the JDate object like this:
$feed[$i]->publishedDate->date
Documentation about JDate can be found here: http://docs.joomla.org/JDate/11.1

Bakual
- 2,731
- 1
- 13
- 16
-
Do you have any idea how to do this with Joomla 2.5 or 3.x as this doesn't seem to work. thanks – Jun 03 '13 at 12:58
-
1Just verified it using Joomla 3.1. It works still the same way. Echoing the above code returns a datetime string. Current JDate API is here: http://api.joomla.org/Joomla-Platform/Date/JDate.html – Bakual Jun 03 '13 at 17:42
0
Echo out the following within your $j loop at (2.5) /modules/mod_feed/tmpl/default.php (recommend you override in your current template):
foreach ($feed->items as $key => $row) {
$pubDate[$key] = $row[feed->data['child']['']['rss'][0]['child']['']['channel'][0]['child']['']['item'][$j]['child']['']['pubDate'][0]['data']];
}
print_r($pubDate);