Adding fields to be displayed with the RSS Reader 2.0

Celero Solutions asked on June 27, 2014 14:14

Hi, I'm using the RSS Reader 2.0 to consume data coming from an CMS RSS feed I placed on another Kentico site that we support. I added additional tags/fields to the transformation for the CMS RSS feed. When I view the source for the feed I can see the tags I had added with data in them. I then added these to the RSS Reader's transformation. However, they are not displaying. The default tags such as description, title and link are displaying their data but not the ones I added. I have them set up as follows with "organization" being one of the new tags:

<h2><a href="<%# Eval("link") %>"> <%# Eval("title") %> </a></h2>
<%# Eval("description") %>
<%# Eval("organization") %>

Recent Answers


Brenden Kehren answered on June 30, 2014 07:22

Have you navigated directly to the RSS feed manually? You might try to use an XML Datasource and a basic repeater. I think you might have better results.

0 votesVote for this answer Mark as a Correct answer

Celero Solutions answered on June 30, 2014 08:50

When you say navigating directly to the RSS feed manually do you mean viewing the RSS feed in a browser? If so then yes I can. While the data in the tags are not visible on the page, when I view the source I can see them there.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on June 30, 2014 12:01

Yes, in the browser. Can you send a snippet of what a record might look like. Depending on the data in the RSS you may have to use EvalCDATA("FieldName", false). Check out the help docs

0 votesVote for this answer Mark as a Correct answer

Celero Solutions answered on June 30, 2014 14:32

Here's what the transformation looks like for the RSS feed:

<item>
 <guid isPermaLink="false"><%# Eval("NodeGUID") %></guid>
 <title><%# EvalCDATA("DocumentName") %></title>
 <description><%# EvalCDATA("NodeAliasPath") %></description>
 <pubDate><%# GetRSSDateTime(Eval("DocumentCreatedWhen")) %></pubDate>
 <link><![CDATA[<%# GetAbsoluteUrl(GetDocumentUrlForFeed(), Eval("SiteName")) %>]]></link> 
<location><%# Eval("Location")%></location>
<organization><%# Eval("Organization")%></organization>
<province><%# Eval("Province")%></province>
</item>

Here's what it looks like when viewing the source of the feed feed i.e. http://albertacentral-old.dev/Alberta-Central-Careers/?item=Careers-at-Alberta-Central.

<?xml version="1.0" encoding="utf-8"?><rss version="2.0">
<channel>
<title><![CDATA[Careers at Alberta Central]]></title>
<link><![CDATA[http://albertacentral-old.dev/Alberta-Central-Careers/?item=Careers-at-Alberta
Central]]></link>
<description><![CDATA[A feed for jobs at Alberta Central]]></description>
<language><![CDATA[en-US]]></language>
<item>
<guid isPermaLink="false">837e4ac4-e065-493c-812e-3914f220ddec</guid>
<title><![CDATA[Business Loans Specialist]]></title>
 <description><![CDATA[/Alberta-Central-Careers/Business-Loans-Specialist]]></description>
 <pubDate>Mon, 13 Jan 2014 19:27:38 GMT</pubDate>
 <link><![CDATA[http://albertacentral-old.dev/Alberta-Central-Careers/Business-Loans-Specialist/?feed=Careers-at-Alberta-Central]]></link> 
<location>Calgary</location>
<organization>Credit Union Central of Alberta</organization>
<province>Alberta</province>
</item>
</channel>
</rss>

And here is the transformation for the RSS Reader on the site consuming the feed:

<h2><a href="<%# Eval("link") %>"> <%# Eval("title") %> </a></h2>
<!--<%# Eval("description") %>-->
<%# Eval("organization") %><%# Eval("location") %><%# Eval("province") %>

It's kind of odd because when I comment out the description and checked the data for the "organization" is now displaying but the locaation and province are not. But you can see above that there is data in it.

0 votesVote for this answer Mark as a Correct answer

Celero Solutions answered on July 3, 2014 12:53

I ended up stepping through the code and saw there was an XSD that it was reading in. I added the xml for the new fields into there and got it working.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.