So – in case folks are curious – I now have both a dishwasher and the Internet back at my house. I feel like I’ve returned to the modern world. (Yes, I’m spoiled.)
Last night instead of my normal useless browsing, I worked up a quick set of tags that will make it easier for folks to use Spry widgets. So for example, to create tabs (with the not yet officially released Spry Tab code), you can do this:
<cf_tab id="demo0">
<cf_page title="Tab 1">
Orig Ganster
</cf_page>
<cf_page title="Tab 2">
Tab 2
</cf_page>
</cf_tab>
Accordions are much more difficult:
<cf_accordion id="demo1">
<cf_page title="Page One">
This is the content for the first accordion panel.
</cf_page>
<cf_page title="Page Two">
This is the second page with some dynamic content, <cfoutput>#timeFormat(now())#</cfoutput>
</cf_page>
</cf_accordion>
The custom tags are smart enough to know when they have been run once in the request and will not re-include the JavaScript files more than once. Before I tell you where to download this – please note that this is very rough code. It doesn’t have documentation (bah, docs are for wimps!) or proper error handling, or even strong testing. It really is just something I was playing with.
This all stemmed from a long talk I had with Charlie Arehart about CF and Spry and he will be working on this project as well. The project is being hosted – where else – at RIAForge: http://cfspry.riaforge.org
I also have some ideas for how to work with Spry datasets as well – but that is still way in the planning stages.
p.s. I said the code was a bit ugly – and it is – but check out how the custom tags are written, especially page.cfm. Notice how it checks for the parent and based on this can check to see if it properly wrapped. Custom tags are cool. Don’t let them CFC folks fool ya!
Tag:
Add to Del.icio.us | Digg | Reddit | Furl
Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com
Raymond Camden is Vice President of Technology for roundpeg, Inc. A long
time ColdFusion user, Raymond has worked on numerous ColdFusion books
and is the creator of many of the most popular ColdFusion community web
sites. He is an Adobe Community Expert, user group manager, and the
proud father of three little bundles of joy.