EE Default RSS Template (Fixed)


/ Published in: XML
Save to your folder(s)

This template removes seconds from date fields used in the which cause multi-posting (on each edit) of entries. These are the minimal fixes to the current default EE RSS Template, I've also uploaded an [improved template](http://snipplr.com/view/25354/ee-rss-template-improved/ ) as well. For more information see my blog post (url above)


Copy this code and paste it in your HTML
  1. {assign_variable:master_weblog_name="blog"}
  2. {assign_variable:master_weblog_status="open"}
  3. {exp:rss:feed weblog="{master_weblog_name}" status="{master_weblog_status}"}
  4.  
  5. <?xml version="1.0" encoding="{encoding}"?>
  6. <rss version="2.0"
  7. xmlns:dc="http://purl.org/dc/elements/1.1/"
  8. xmlns:admin="http://webns.net/mvcb/"
  9. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  10. <channel>
  11. <title>{exp:xml_encode}{weblog_name}{/exp:xml_encode}</title>
  12. <link>{weblog_url}</link>
  13. <description>{weblog_description}</description>
  14. <dc:language>{weblog_language}</dc:language>
  15. <dc:creator>{email}</dc:creator>
  16. <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
  17. <dc:date>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
  18. <admin:generatorAgent rdf:resource="http://expressionengine.com/" />
  19. {exp:weblog:entries weblog="{master_weblog_name}" limit="10" rdf="off" dynamic_start="on" disable="member_data|trackbacks" status="{master_weblog_status}"}
  20. <item>
  21. <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
  22. <link>{title_permalink=site/index}</link>
  23. <guid isPermaLink="false">{title_permalink=site/index}#When:{gmt_entry_date format="%H:%iZ"}</guid>
  24. <description>{exp:xml_encode}{summary}{body}{/exp:xml_encode}</description>
  25. <dc:subject>{exp:xml_encode}{categories backspace="1"}{category_name}, {/categories}{/exp:xml_encode}</dc:subject>
  26. <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i%Q"}</dc:date>
  27. </item>
  28. {/exp:weblog:entries}
  29. </channel>
  30. </rss>
  31. {/exp:rss:feed}

URL: http://23rdworld.com/2009/12/23/how-to-fix-your-expressionengine-rss-template/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.