Page 1 of 1

Add pubDate to RSS feeder?

Posted: Wed Dec 19, 2007 2:08 pm
by brianpeat
Does anyone know what code I'd add to the various files in the mod_feed module to add the pubDate tag to my feeds? I'm building a news headlines site for a client and they really want author and date. Many feeds don't list the Author, so I'm not too worried about that, but I'm sure there's a way to add the pubDate tag to the feeder, I just don't know the exact code. I tried to do it myself and all I get are errors (which didn't surprise me in the least).


Re: Add pubDate to RSS feeder?

Posted: Wed Dec 19, 2007 2:25 pm
by brianpeat
Argh! I just realized too that the feed titles (not the item titles) don't link back to the original feed. Yet another problem I need a solution for.

I went with Joomla 1.5 because it's the future...only THEN did I realize none of the fancy RSS readers are available for it :)

EDIT: I realized I could turn off the module title and turn on the feed title, but then it's simply a link to the host web site. Oh well, it's a start.

Re: Add pubDate to RSS feeder?

Posted: Sat Jan 08, 2011 4:27 am
by 102020
Old post, but here is the answer. I assume users are using mod_feed and want to show the pubDate field from within the xml. Easiest way is to insert the following in default.php in your tmpl folder for mod_feed. You should be using an html override of coarse.

in default.php find:

Code: Select all

for ($j = 0; $j < $totalItems; $j ++)
add the following anywhere between the for statement:

Code: Select all

echo $feed->items[0]->feed->data['child']['']['rss'][0]['child']['']['channel'][0]['child']['']['item'][$j]['child']['']['pubDate'][0]['data'];
Hope this helps,