Joey Robichaud

code and thoughts

GiveCamp Day 2

After a refreshing 6 hours of sleep, we met the following morning!

The first task we had before us was to implement a simple widget to learn the Sitefinity APIs. For the sake of tradition, we implemented a ‘Hello World’ widget which simply displayed a configurable message in a tag. Using one of their included widgets as a starting point, it did not take long until we had our widget put together. John shot us a very helpful PDF that included the instructions to register the widget with our local Sitefinity instance, and we were off running!

Several of the widgets that we needed to implement were image rotating controls. The first of the Social Widgets to be implemented was a Facebook image rotator. Since we saw a lot of potential overlap, we worked on this widget together so that we could both have input on the pattern we’d follow for the others.

The first step to implementing the Facebook widget was to pull a list of images from the Facebook API. We registered a Facebook application with Joy’s account and added the application to the Spirit of Hope Youth Ranch on Facebook page. After trying various FBML and FQL queries, we discovered the [Facebook C# SDK](http://facebooksdk.codeplex.com/]. After a little tweaking, we were able to pull in recent images from an account with an option to limit it to a specific album.

With this out of the way, we focused on implementing the image rotation. While David had been focusing on implementing the Facebook query, I had been writing a little jQuery in Notepad++. I shared this with David, and we soon had a working image rotator.

Mixing these two pieces together got us most of the functionality. All that remained was adding a lightbox when the image was clicked. A quick Google search later and we had decided that prettyPhoto had the right mix of style and functionality.

Now that we had the first component mostly put together, I proceeded to implement a Flickr rotator while David incorporated the prettyPhoto plugin. I was much more successful than David (through no fault of his own – stay tuned for Day 3 to find out what happened!). I was able to reuse the query from another baked-in Flickr widget for pulling images from a user account. The most difficult part was determining the user id to use in the query. Luckily there is a handy site for getting the user id from a Flickr user name.

With Dave seemingly at a dead end trying to get jQuery plugins working with Sitefinity, I proceeded to knockout the YouTube video rotator widget. By this point the host facility was shutting down, but the other members of our team had plans to work overnight. They were battling some layout issues getting Sitefinity to play nice with Brant’s design. We felt we had a firm grasp on our task, so we headed home to get some much needed shut eye.

Also, I fell on some wickedly icy stairs, and David’s car battery died. Bryan and Josh, who were crashing at Dave’s place, made a great rescue team. Thanks, guys!

This post originally appeared on The DevStop.