BlogCFC currently uses RSS 1.0 in the generated RSS feeds. Most podcasting clients, such as Feed Demon, do not support attachments in RSS 1.0 feeds even though both RSS 1.0 and 2.0 support the enclosure tag. I've recently come up with an idea for a new series of podcasts which I hope to begin producing soon, so rather than fight with RSS 1.0 and podcasting clients, I've added RSS 2.0 support in BlogCFC.

Below is a replacement for BlogCFC 3.5.2 generateRSS() method call which allows generation of either RSS 1.0 or 2.0. Feeds generated with this successfully validate. The RSS 2.0 feed does not yet generate enclosure tags for podcast attachments, a task to be done later. Since the RSS 1.0 feed is well-formed XML with XML directives I have a stylesheet directive for easier viewing, but since RSS 2.0 feed does not have XML directives, I have not included any style information in that feed.

Note that the RSS 2.0 feed includes the optional managingEditor and webMaster elements which require an email address. Remove these two optional elements from the code if you don't want to have your email published in the RSS feed.

To use the new RSS generator:

  • Backup the existing version of {blog}/org/camden/blog/blog.cfc
  • Open blog.cfc for editing
  • Change 1: Replace the CFFUNCTION tag block for generateRSS with this code block
  • Change 2: Edit {blog}/rss.cfm to enable a new query string parameter &ver= to switch RSS views by version
  • Change 3: Edit {blog}/includes/pods/rss.cfm to pass querystring parameters as shown in right sidebar menu
  • Login and refresh the blog with ?reinit to make changes take effect




Change 1 generateRSS - {blog}/org/camden/blog/blog.cfc

Click to view code


Change 2 {blog}/rss.cfm (code snippet)

[cfif not isdefined('url.ver')>
[cfset variables.ver = 1>
[cfelse>
[cfset variables.ver = trim(url.ver)>
[/cfif>
[cfswitch expression="#variables.ver#">
[cfcase value="1">[cfset variables.version = 1>[/cfcase>
[cfcase value="2">[cfset variables.version = 2>[/cfcase>
[cfdefaultcase>[cfset variables.version = 1>[/cfdefaultcase>
[/cfswitch>

[cftry>
[cfcontent type="text/xml">[cfoutput>#application.blog.generateRSS(mode=mode,params=params,version=version)#
[/cfoutput>



Change 3 {blog}/includes/pods/rss.cfm (code snippet)