Archive for May 1st, 2008

My New Widget Architecture

I was chatting with David Marks of Loomia about the version 4 rewrite of The Conversations Network’s web sites, and he asked whether I’d blogged about it. Haven’t yet, so here’s part of it…

The new sites will be extremely dynamic with nearly everything loaded at runtime via Ajax widgets, some nested within other widgets, sometimes three-deep. Even with all the HTTP requests, the pages are so much simpler and built with so many fewer lines of code, the new site is noticeably faster.

Placing a widget on a page is about as simple as it gets. For example, the following HTML is all it takes to display the most-popular recently published shows for a channel:

<div class=”cnWidget mostPopularRecent”></div>

My widgetLoader looks for <div> elements with className ‘cnWidget’. In the above case it then makes a prototype.js Ajax call to /widget/mostPopularRecent (which is rewritten to mostPopularRecent.php in our case), which then returns the content of the <div>. Dirt simple!

For widgets that require arguments, I just include the values as a Json string within the <div> such as:

<div class=”cnWidget selectedTopics” style=”display:none”>
    ["software","blogging","opensource","security"]
</div>

Redesigning the pages takes nothing more than moving the widgets around and changing the CSS. And in version 4.1 I hope to have a drag-and-drop tool for adding and moving widgets.

Remembering Tom LeVine

I was saddened to return home today after an east-coast trip to be greeted with the news that Tom LeVine had died from a brain tumor diagnosed only two months ago. Tom was the CEO of Pop!Tech, a marvelous annual event held in Maine every year. IT Conversations streamed live audio from Pop!Tech 2004 and 2005 thanks to Tom’s believe in our mutual missions.

I first met Tom about 13 years ago when he was working in venture capital. We worked together to start an online business, but it never happened. Years later, Tom and I were both happy the project never got off the ground for a variety of reasons. We remained friends and sometimes shared a meal when he was in the Bay Area. As the Pop!Tech announcement says, Tom was one of those incredibly healthy and active people we all figure would outlive the rest of us. Alas, he passed away at the age of 56. He is already missed, and will be for some time.