// you’re reading...

CMS

Creating RSS Feed in RedDot CMS


Screenshot of the RSS Feed Template
Screenshot of the RSS Feed Template

This is a classic article about how to create a RSS Feed using our beloved CMS and this topic has been asked about 5 million times now on Google Groups Wiki and everywhere else… This question or furthermore one of these variations below will now be answered:

How to get an RSS Feed for my Open Text project?

  • How do I create an RSS Feed in Open Text Web Solutions Management Server?
  • How do I set up an Podcast?
  • How can I create a news feed for my news section?
  • How do I get my news list as a XML document

To create an RSS Feed within RedDot CMS you just need ONE template.
There is no need to create a separate XML variant or anything like this.
Just change the elements within the template to match your news elements and you are ready to go.
Don’t change the date element, this is a sensitive one which needs some ASP script to read a proper readable date for the RSS Feed.

The RSS Feed Template

The template below makes use of some nice Render Tags which you should check out. Especially the Render Tag described in the SEO article come in handy when you link news from different sections within the project connected to your RSS feed list using keywords.

Explanation of RedDot Elements

So what did we do here? Let’s have a closer look at the single bits and pieces within the template.
The first part contains two ASP functions “GetMonthName” and “GetDayName” to render the date returned by the RedDot element stf_pageDate properly in a RSS format. So DON’T TOUCH THE stf_pageDate element.
Then we have this part in the links:

<%stf_siteURL%><%!! Escape:HtmlEncode(Context:Indexes.GetIndexByPageId(Guid:<%info_PageGuid%>).Page.GetUrl()) !!%>

The siteUrl element should be the URL of your site (for example: www.reddotcmsblog.com if this would be your site..)
The second Render Tag bit returns the MainLink of the page to the linked site no matter what publication package is assigned to the RSS Feed.
All the other bits and pieces should be self-explaining.

Integration into my Open Text project

To integrate this template in your project:

  1. Download the template below
  2. Donate a decent amount to keep this site running
  3. Import the template into your project
  4. Make sure PreExecute is activated for your project
  5. Create a page based on this template
  6. Reference the list inside the template to your news list
  7. Create a publication package for the RSS Feed list so that your pages get published into a hidden folder (this is to avoid double indexed files in your site search)
  8. Change the filename to yourfeedname.xml
  9. Integrate the file into your HTML page templates with something like this
  10. Publish everything
  11. You are done. Get yourself a Cookie!

Disclaimer & Credits

Feel free to re-use the code linked below. Don’t use the code above because it is just an example and it gets scrambled by the Syntax Highlighter. However both versions come with no warranty. When re-used by you we expect you to attribute this work and use it according to the CC license BY-SA 3.0. Thanks to the famous Plugin Developer and super coder Kim Dezen who helped me out with the code bits but hates writing other things than pretty code so I have to do it.
It also needs to be said that this example is a very basic one and you can enhance any fields you need. Feel free to send us your examples if you have improved this marvelous Open Text solution!

Download and Donate

We can’t get around to outline it and remind you. This site still runs for free. And this won’t change from todays point of view unless we manage to convince OpenText to make a bigger donation because we solve at least as many support requests per day as they do.
So grab your code, enjoy the work we share here with you and if you find it useful then after downloading the template feel free to donate (it should be enough for a beer..).

Share and Enjoy:
  • Print
  • email
  • Twitter
  • Digg
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • del.icio.us
  • MisterWong
  • Facebook
  • LinkedIn

No related posts.

About the author:

Markus Giesen Markus Giesen is a Solutions Architect and RedDot CMS Consultant, formerly based in Germany. Travelling around the world to find and offer solutions for a better world (in a very web based meaning). He just found a way to do this as part of a Melbourne based online consultant house. On this blog Markus shares his personal (not his employers) thoughts and opinions on CMS and web development. In his spare time you will find him reading, snowboarding or travelling. Also, you should follow him on Twitter!

Discussion

18 comments for “Creating RSS Feed in RedDot CMS”

  1. Dude, your code has been seriously beat up by auto filters…

    Posted by Rob W | November 25, 2009, 12:27 am
  2. Hey Rob, that’s true.. The Syntax Highlighter doesn’t work properly because it doesn’t know the RedDot template language.
    Therefore I removed it and put a screenshot in place.
    Sorry about that, just use the download to get the template.

    Posted by Markus Giesen | November 25, 2009, 7:55 am
  3. Great approach. I just integrated it into my current project and modified it a bit to fit my needs. Due to my passion to php i’ve deleted the preexecute-functions in the head and replace the date output to: <?php echo date("r", strtotime("”)); ?>.

    Posted by Ingo Hillebrand | December 1, 2009, 12:45 pm
  4. Don’t be shy. Feel free to send me your PHP version. I would be happy to add it to the article :)

    Posted by Markus Giesen | December 1, 2009, 12:53 pm
  5. Hi Markus, great template, very useful.
    Wonder if you could elaborate: do you create an Unlinked Page for the feed? I tried this but the link to the feed in the source code went to an error…didn’t seem to get published.

    Posted by Neil | December 2, 2009, 12:46 pm
  6. Hey Neil, all I did was create an unlinked (not connected to navigation manager) page and assigned a publication package which publishes the file into the root folder. Let me know if this helps, otherwise I can certainly provide some more details.

    Posted by Markus Giesen | December 2, 2009, 1:42 pm
  7. Hi Markus. Got it working to a point; can’t get the last part of the URL (e.g. article-name.htm to publish within the feed but can work on that). I’ve created a couple of dynamic links for a news and events feed from an unpublished ’start’ page – does this sound like a suitable way to do it?

    Posted by Neil | December 3, 2009, 11:10 am
  8. Hey Neil, that sounds like the right way to do it. Why can’t you get the filename of the page?
    You could use an info element or (better) the Render Tag within the template.

    Posted by Markus Giesen | December 5, 2009, 6:14 am
  9. Hi Markus,

    I’ve implemented RSS feeds similar to yours into our website, but I’m confronted with the following problem: my RSS pages are published to 2 different websites (internetsite and intranetsite) . I don’t have any idea how to get the to change it’s value according to the site where the RSS page is published. For the moment the RSS feeds are only functional on the internetsite. Thx in advance for any advice to help me solve this problem.

    Posted by Bart Maes | February 2, 2010, 3:33 pm
  10. The value that causes me headache is of course the value of the variable stf_siteURL.

    Posted by Bart Maes | February 2, 2010, 3:34 pm
  11. Hey Bart! In that case I would just create another page based on the RSS template, append a different publishing target and change the standard field value for this page.
    Does that work at for you?

    Posted by Markus Giesen | February 2, 2010, 3:47 pm
  12. Hi Markus,

    Your solution is clearly the correct one.
    The RSS feed however is present in a page using an anchor element so people can subscribe to it (that’s nice).
    If I create a second RSS feed, I have to create a second anchor in that so called subscriber page, meaning the 2 anchors will be visible in this page,
    although only 1 anchor will work depending on the website it is published to.
    This will make certain people go crazy, and since there are enough fools on this planet, I’ve decided to let it rest in peace.

    Posted by Bart Maes | February 3, 2010, 11:35 am
  13. Having to deal with two different sites using one data source but two different types of URLs / folder structures is always a fun part..

    You can put the link to the RSS feed into a variable and ON the published site run a script over it to find out which URL it is and then use a if/else to show either the RSS link a or the RSS link b with the correct prefixing.

    Generally I think serving two different websites based on ONE RedDot project causes trouble too often.

    Posted by Markus Giesen | February 4, 2010, 2:32 am
  14. Hi Markus/guys

    This works perfectly for a feed of our news articles but as our articles just take that day’s date for publishing, there’s no need to enter it manually as a standard field, just use an info element for the date creation.

    I thought it would be straightforward to ’swap’ the stf_date for an info_date but it doesn’t seem to bring anything through – any ideas?

    Thanks

    Neil

    Posted by Neil Fegen | May 20, 2010, 5:34 pm
  15. Neil, that should work as you have described it. Does the info element exist in both templates? The news template itself and the RSS feed template?

    Posted by Markus Giesen | May 26, 2010, 6:22 am
  16. Hi Markus, thanks for replying.

    Yes, added to both…solved it by adding a second, hidden in the news template with a different date output format and using this in the RSS feed.

    Seemed to not work due to the format in the RSS template but found an example in the Google Groups forum which used the following (rather complicated) date format:

    ddd, dd MMM yyyy HH’:'mm’:’ss ‘UTC’

    This has done the trick, and now outputs the date in the RSS feed, while the original displays as a regular ‘26 May 2010′ style.

    Cheers

    Neil

    Posted by Neil | May 26, 2010, 12:42 pm
  17. Just as an FYI, we have used this in v10.1 with some issues. Specifically we have the list from the RSS referencing a list which has sort order settings on it. It appears that doing so will cause the source list to not obey the sort order settings.

    I am now testing to see if applying the same keywords, etc to the RSS list will produce the RSS feed without the side effect of the source list not obeying the sort order settings.

    If anyone has any idea as to why the list would randomly “misbehave”, any help is appreciated.

    Posted by Joel Kinzel | October 18, 2010, 6:04 pm
  18. How would you add XSLT or CSS to this feed. I have used your example and got the necessary feed up and running, but now I am stuck trying to figure out how to add or XSLT into this.

    Thoughts?

    Posted by Jason Huisheere | June 6, 2011, 8:48 pm

Post a comment



Stay up to date! - Get notified about followup comments

If you don't feel the urge to comment but wish to stay in the loop:
Just enter your email and subscribe to new comments.

Subscribe without commenting

Recent Tweets

  • RT @AirKraft: Transport Canada breakout: they manage 80K pages and 300K assets with WSM(RedDot). Wow! #OTCW 2010-11-11
  • The RedDot usergroup session 'Future of WCM' is in National Harbor 7, now. See you there! #otcw 2010-11-11
  • RT @yttergren: @AirKraft: Calling all WSM(RedDot) devs: share your solutions on http://bit.ly/bgPIof EVERY solution can win an iPad #OTCW 2010-11-10
  • Come to the Solution Exchange session. Enhance your (#reddot) CMS project! Chesapeake 12, 3:20pm #otcw Looking forward to see you there! 2010-11-10
  • More updates...