Posted By


mahalie on 12/23/09

Tagged


Statistics


Viewed 786 times
Favorited by 1 user(s)

EE RSS Template Improved


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

Template includes optional changes from the default EE RSS template that I added as a result of various articles, the RSS 2.0 spec and by examining the feeds of major professional news sites. For more information see my blog post (url above). Tested and validated at http://feedvalidator.org. (The default EE RSS feed does not.)


Copy this code and paste it in your HTML
  1. {assign_variable:master_weblog_name="BLOG"}
  2. {assign_variable:master_weblog_status="OPEN"}
  3. {assign_variable:master_rss_uri="http://PATH/TO/THIS/RSS/FEED"}
  4.  
  5. {exp:rss:feed weblog="{master_weblog_name}" status="{master_weblog_status}"}
  6. <?xml version="1.0" encoding="{encoding}"?>
  7. <rss version="2.0"
  8. xmlns:dc="http://purl.org/dc/elements/1.1/"
  9. xmlns:atom="http://www.w3.org/2005/Atom">
  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. <pubDate>{gmt_date format="%D, %d %M %Y %H:%i:%s %T"}</pubDate>
  18. <atom:link href="{master_rss_uri}" rel="self" type="application/rss+xml" />
  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 protect_entities="yes"}{title}{/exp:xml_encode}</title>
  22. <link>{title_permalink=site/index}</link>
  23. <guid isPermaLink="false">{title_permalink="site/index"}#id:{entry_id}#date:{gmt_entry_date format="%H:%i"}</guid>
  24. <description><![CDATA[{summary}{body}]]></description>
  25. {categories}<category>{exp:xml_encode protect_entities="yes"}{category_name}{/exp:xml_encode}</category>
  26. {/categories}
  27. <pubDate>{gmt_entry_date format="%D, %d %M %Y %H:%i %T"}</pubDate>
  28. </item>
  29. {/exp:weblog:entries}
  30. </channel>
  31. </rss>
  32. {/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.