The other title was, How I added the FeedBurer URL to BlogCFC - imagine whatever your prefer :o)
If you haven't heard Feedburner has recently been acquired by Google. Which as it seems with all Google acquisitions means us users end up getting something free out of it and to with keep up traditions Feedburner now offer their "Pro" services for free.
Now I do like the idea of Feedburner but I never get around to putting the URL back into BlogCFC after I upgrade; so I took a little time out over lunch to create a new property in BlogCFC.
The idea is simple: Add a new property called altFeedURL. If you have an alternative feed add the value, if not BlogCFC will default to the standard root.url/rss.cfm?mode=full
So in 5 easy steps this is what I did:
-
File: /org/camden/blog/blog.ini.cfm
Added extra property to the end of the file
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
altFeedUrl=http://feeds.feedburner.com/[Your Feed Burner Reference]
1 altFeedUrl=http://feeds.feedburner.com/[Your Feed Burner Reference]
-
Files: /org/camden/blog/blog.CFC
In the init() method add the following to the instance struct.
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<cfset instance.altFeedUrl = variables.utils.configParam(variables.cfgFile, arguments.name, "altFeedUrl")>
1 <cfset instance.altFeedUrl = variables.utils.configParam(variables.cfgFile, arguments.name, "altFeedUrl")>
-
File: /Application.cfm
Around line 88 (After the root URL is set in the application scope)
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<cfif len(trim(application.blog.getProperty("altFeedUrl")))>
<cfset application.feedURL = application.blog.getProperty("altFeedUrl") />
<cfelse>
<cfset application.feedURL = application.rootURL & "/rss.cfm?mode=full" />
</cfif>1 <cfif len(trim(application.blog.getProperty("altFeedUrl")))>
2 <cfset application.feedURL = application.blog.getProperty("altFeedUrl") />
3 <cfelse>
4 <cfset application.feedURL = application.rootURL & "/rss.cfm?mode=full" />
5 </cfif>
-
File: /tags/layout.cfm
Change the link in the header to
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<link rel="alternate" type="application/rss+xml" title="RSS" href="#application.feedURL#" />
1 <link rel="alternate" type="application/rss+xml" title="RSS" href="#application.feedURL#" />
-
File: /includes/pod/rss.cfm
Change the href to
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<a href="#application.feedURL#" rel="noindex,nofollow"><img src="#application.rootURL#/images/rssbutton.gif" border="0"></a>
1 <a href="#application.feedURL#" rel="noindex,nofollow"><img src="#application.rootURL#/images/rssbutton.gif" border="0"></a>
and delete the following line as it is no longer needed
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<cfset rssURL = application.rootURL & "/rss.cfm">
1 <cfset rssURL = application.rootURL & "/rss.cfm">
Please also note that the above is also just a general guide to adding whatever property you want as well :o)
stylesheet=mystyle.css
layoutcfm=my_layout.cfm
The layout could be used to replace the layout.cfm calls with a customized file instead of Ray's layout.cfm.
It would be nice to be able to add the value in to the .ini file, and it show up with out then having to add the code to the core blog.CFC
Rather than hard coding the loading of the variables, just have it so it loops over them and loads them, as in the ini file will only work with simple name/value pairs...
I think I'll suggest this to the blogCFC team :-)