RSS Format
I am having an issue with the format of the RSS URL for each
article. The URL protocol output says: site instead of http
#set ( $currentDate = $_DateTool.getDate() )
#set ( $callingPage = $_XPathTool.selectSingleNode($contentRoot, "/system-index-block/calling-page/system-page") )
#set ( $features = $_XPathTool.selectNodes($contentRoot, "/system-index-block/system-page[path != '/_internal/base assets/article']") )
$_SortTool.addSortCriterion("start-date", "", "number", "descending", "")
$_SortTool.sort($features)
#set ( $pageTitle = $_SerializerTool.serialize($callingPage.getChild("title"), true) )
#if (!$pageTitle)
#set ( $pageTitle = "Volunteer State News" )
#end
#set ( $pageDescription = $callingPage.getChild("summary").text.replace("&", "&") )
#if (!$pageDescription)
#set ( $pageDescription = "Current News for Volunteer State" )
#end
<rss version="2.0">
<channel>
<title>$pageTitle</title>
<link>$callingPage.getChild("link").value</link>
<description>$pageDescription</description>
<language>en-us</language>
<pubDate>$_DateTool.format('E, d MMM yyyy HH:mm:ss z', $currentDate)</pubDate>
<generator>Cascade Server</generator>
#foreach ( $feature in $features )
#set ( $dateNode = $feature.getChild("start-date").value )
#set ( $startDate = $_DateTool.getDate($dateNode) )
#set ( $url = $feature.getChild("link").value )
#set ( $summary = $feature.getChild("summary") )
<item>
<title>$_SerializerTool.serialize($feature.getChild("title"), true)</title>
<link>$url</link>
<description>$_SerializerTool.serialize($summary, true)</description>
<pubDate>$_DateTool.format('E, d MMM yyyy HH:mm:ss z', $startDate)</pubDate>
<guid>$url</guid>
</item>
#end
</channel>
</rss>
Here is the output:
<rss version="2.0">
<channel>
<title>News & Stories</title>
<link>site://volstate.edu/Stories/index</link>
<description>Current News for Volunteer State</description>
<language>en-us</language>
<pubDate>Thu, 13 Feb 2014 14:27:59 CST</pubDate>
<generator>Cascade Server</generator>
<item>
<title>Vol State at Livingston and TTU Team Up to Help High School Students</title>
<link>site://volstate.edu/Stories/2014/02/vol-state-at-livingston-and-ttu-team-up-to-help-high-school-students</link>
<description>The program helps dual enrollment students get ready for college level classes.</description>
<pubDate>Thu, 13 Feb 2014 01:00:00 CST</pubDate>
<guid>site://volstate.edu/Stories/2014/02/vol-state-at-livingston-and-ttu-team-up-to-help-high-school-students </guid>
</item>
<item>
<title>Hendersonville Student Named to All-Tennessee Academic Team</title>
<link>site://volstate.edu/Stories/2014/02/hendersonville-student-named-to-all-tennessee-academic-team</link>
<description>Joseph Olson represents the Phi Theta Kappa honors society.</description>
<pubDate>Wed, 12 Feb 2014 01:00:00 CST</pubDate>
<guid>site://volstate.edu/Stories/2014/02/hendersonville-student-named-to-all-tennessee-academic-team</guid>
</item>
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Jefferson Furta... on 13 Feb, 2014 11:16 PM
OK. I made the following changes and got the link to work, but I am wondering if there is a better way of doing it:
2 Posted by Ryan Griffith on 14 Feb, 2014 01:36 PM
Hi Jefferson,
Currently, appending a static URL onto the front and extension onto the end is the way we typically use to accomplish this, because there is currently no means of finding the Site URL dynamically.
One thing you may be able to try is to move the RSS Page to another Site and use the value of the link element. This would create a cross-site link, which should automatically add the Site URL and page extension to the link when published.
Please let me know if you have any questions.
Thanks!
Jefferson Furtado closed this discussion on 14 Feb, 2014 04:04 PM.