CFTimeline for blogCFC
I've just played about with Todd Sharps cfTimeline and i have to say it's really nice.
I wanted to see how it would work consuming a blogCFC feed so here's the code:
<head>
<title>Feed on cf_timeline</title>
</head>
<body>
<cfset blogRSS = "http://succor.co.uk/rss.cfm" />
<cfhttp url="#blogRSS#" result="feed" />
<cfset feeds ="#xmlParse(feed.fileContent)#">
<cf_timeline id="feedTimeline" timelineHeight="200" start="#now()#" style="font-size: 8pt; font-family: Trebuchet MS, Helvetica, Arial, sans serif; border: 1px solid ##aaa;">
<cf_timelineband bandHeight="80" showEventText="true" dateUnit="hour" intervalWidth="100" />
<cf_timelineband bandHeight="20" showEventText="false" dateUnit="day" intervalWidth="100" highlight="true" trackHeight="0.5" trackGap="0.2" />
<cfoutput>
<cfloop from="1" to="#arrayLen(feeds["rss"].channel.item)#" index="post">
<cfset thisPost = feeds["rss"].channel.item[post]>
<cfset posted = dateformat(thisPost["pubdate"].XMLText, "mm/dd/yyyy") & " " & timeformat(thisPost["pubdate"].XMLText, "HH:mm:ss")>
<cf_timelineevent title="#thisPost.title.XMLText#" link="#thisPost.link.XMLText#" start="#posted#" description="#thisPost.description.XMLText#">
</cfloop>
</cfoutput>
</cf_timeline>
</body>
</html>
You will need the timeline files in the same folder but it works a treat. Check mine out here. Click on a post entry for the description. You may have to scroll a little as I've not been blogging much lately - sorry.
Thanks for the great work Todd.




