RSS

How do I get fancy urls in my RSS feed?

Written and contributed by Dugge.

Original forum thread:
http://forum.nucleuscms.org/viewtopic.php?t=7630

NOTE:
This tutorial assumes you have already configured fancy urls to work on your Nucleus installation.

Your average RSS file looks something like this:
An average RSS file

Notice the code/url in this format:

 
<link>http://www.hobbyman.se/index.php?itemid=10</link>

It's not so fancy at the moment, right? To make your RSS feed use fancy urls you need to make some small changes in your RSS template. You can find your RSS template in your Nucleus admin area by clicking on 'Templates'. Click on the 'Edit' link of the RSS template to make some changes:

RSS template in the Nucleus admin area

You should now see a screen that looks like this:
An RSS template

There are lots of parts to the template, but we're going to concentrate on the "Item Body" template part. This is the code we are going to replace to get fancy urls to work in our RSS feed. This is the code in the "Item Body" section:

<item>
<title><%title(xml)%></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>
</item>

Replace that whole section of code with this code:

<item>
 <title><![CDATA[<%title%>]]></title>
<link><%blogurl%>item/<%itemid%></link>
<description><![CDATA[<%body%><%more%>]]></description>
 <category><%category%></category>
<comments><%blogurl%>item/<%itemid%></comments>
 <pubDate><%date(rfc822)%></pubDate>
</item>

Click on "Update Template" to save your changes:
Save your changes.

Your updated RSS feed should now look like this. Notice this code/url once again:

 
<link>http://www.hobbyman.se/item/10</link>

Updated RSS feed

section: RSS | submitted by Leng on 2006.Oct.15 | 4165 views

item rate
Total votes: 4 - Rating: 9.75

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

10