RSS

How do I validate my RSS feed?

Scenario:
"I want to make sure my RSS feed is valid and I also want to have a link to demonstrate this, like the 'Valid XHTML' links. What do I need to do?"

Solution:

  1. Place the following link where you want it to appear in your skin[1]:

    <a href="http://feedvalidator.org/check.cgi?url=http%3A//www.yourdomain.com/xml-rss2.php">Valid RSS</a>

    where "www.yourdomain.com" is your domain.

  2. Edit your feed/rss20 template and insert the following code before the "<item>" line:
    <guid><%blogurl%>index.php?itemid=<%itemid%></guid>

    like this:

    <item>
     <title><![CDATA[<%title%>]]></title>
    <link><%blogurl%>index.php?itemid=<%itemid%></link>
    <description><![CDATA[<%body%><%more%>]]></description>
     <category><%category%></category>
    <comments><%blogurl%>index.php?itemid=<%itemid%></comments>
     <pubDate><%date(rfc822)%></pubDate>
     <guid><%blogurl%>index.php?itemid=<%itemid%></guid>
    </item>
  3. If you want, you can use a button generator, such as Adam Kalsey's Button Maker to make a neat "RSS|Valid" button as the validation link.

Footnotes:
1. Using the default skin as an example, go to your Nucleus Admin area and click on "Skin Files". Click on the "default" folder and the "Edit" link next to "footer.inc". Replace the following code:

<div id="copyrights">
	<small>Copyright | <a href="http://nucleuscms.org"><%version%></a> | 
	<a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0 Strict</a> | 
	<a href="http://jigsaw.w3.org/css-validator/">Valid CSS</a> | 
	<a href="#top">Back to top</a></small>
</div>

with this:

<div id="copyrights">
	<small>Copyright | <a href="http://nucleuscms.org"><%version%></a> | 
	<a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0 Strict</a> | 
	<a href="http://jigsaw.w3.org/css-validator/">Valid CSS</a> | 
	<a href="http://feedvalidator.org/check.cgi?url=http%3A//www.yourdomain.com/xml-rss2.php">Valid RSS</a>
	<a href="#top">Back to top</a></small>
</div>

Original forum thread (thanks, NeoCon Hitman!):
http://forum.nucleuscms.org/viewtopic.php?t=12036

section: RSS | submitted by Leng on 2006.May.06 | 3603 views

item rate
Total votes: 6 - Rating: 8.00

Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

10