>> GreenByte.info By Nick Tong (quiksilv) | Supported by: TalkWebSolutions.co.uk

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:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html>
<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>

I had issues using the XMLformat on line 162,163 in timeline.cfm. I found using JSStringFormat worked better.

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.


 
Comments
todd sharp's Gravatar Cool! I actually fixed the JSStringFormat issue yesterday and will be posting the new code later this week.
# Posted By todd sharp | 21/05/07 11:29 | Report abusive comment
BlogCFC was created by Raymond Camden. This blog is running version 5.5.1.