in

Telligenti

Serving up fresh ideas every day, Telligent style

Kevin Harder

March 2008 - Posts

  • Add a Silverlight photo gallery to your Graffiti site

    A few weeks ago Andrew Duthie modified the default Graffiti theme by adding in the Slide.Show Silverlight photo gallery control, with a hand written configuration and data xml files, and shared it with the Graffiti team at Telligent. I had not seen the Slide.Show control before and it looked amazing! Especially for being free and relatively new.

    Slide.Show was developed by Vertigo Software as a demonstration of Silverlight's power and flexibility. It was then released as an open source project on CodePlex. It consists of a few javascript files that retrieve the album and photo data via XML, JSON, or a built-in Flickr provider and renders the Silverlight.

    I thought it would make a great Graffiti plugin. The plugin can render the necessary javascript and dynamically create the configuration and data xml files so you don't have to modify your theme or manually create any xml files. I also found an additional Slide.Show data provider javascript that allows it to retrieve photos from Google Picasa Web Album which was written by Wesley Riley.

    So I built three very similar plugins that use the Slide.Show control to display a photo gallery on a post page. The difference between them is in where they get the photos from:

    • Slide.Show Photo Gallery Plugin - This plugin looks for photos on the web server. Create a folder to be the "root" of the photo gallery and enter that in the plugin configuration. Inside of this root folder, create subfolders for each album. Put the image files that go in each album in the respective album folder. You can optionally create a plain text file called "album.txt" inside each album folder that contains the album description.
    • Flickr Slide.Show Photo Gallery Plugin - This plugin uses the Flickr API to retrieve photos from a user account on Flickr. Flickr sets are displayed as albums in the gallery. This is currently running on this site.
    • Picasa Slide.Show Photo Gallery Plugin - This plugin uses the Picasa API to retrieve photos from a user account on Google Picasa Web Albums. Albums in Picasa are displayed as albums in the gallery.

    You can now download a beta version of these plugins now on the download page. You need to have Silverlight 1.0 installed to view the gallery.

    If you try out one of these plugins, please send me feedback about any issues you run into and suggested improvements. You can use the contact form on this site or email me at kevin _at_ kevinharder.com. Once they get tested a little more I'll make any needed changes and re-release it, along with the full source code.

    Disclaimer: They are being released as a beta because I have not had time to fully test every combination of the options. Also, I have seen one instance where the Picasa plugin would not download pictures from the Picasa API for some reason, but then worked after a refresh. I had started working on a feature to automatically generate thumbnail images when using the folder version of the plugin, but removed it from this version as I need to get more info about what sizes Slide.Show uses. Use these plugins at your own risk.


    Tagged as graffiti , plugins , slide-show

    Similar Posts

    1. Live Blogging the CSDC - Part 2
    2. Now Graffiti Powered
    3. Live Blogging the CSDC - Part 3

  • First Graffiti Update Delivers Tasty New Events

    Graffiti 1.0 Service Pack 1 (a.k.a. v1.0.1), the very first update of Graffiti CMS, was publicly released this morning. Go download it and update your sites. Or install it if you haven't yet tried out Graffiti!

    You can read the full list of included changes and fixes on the official Graffiti blog. But to sum it up, we fixed just about every bug that had been reported to us since the initial release and threw in a few new features and lots of extensibility goodness.

    My favorite things in v1.0.1 are all the new events that were created to enable Graffiti plugins to add a whole lot of additional functionality to a (IMHO) elegant and flexible core. A couple of plugins I have been working on recently take advantage of the new events, such as the soon-to-be-released Blog Extensions plugin and Slide.Show Photo Gallery plugin. Here is the scoop on the new events:

    AfterInsert - DataObjectEventHandler(DataBuddyBase dataObject, EventArgs e)
    Called after an object is inserted into the database. The dataObject parameter is the object that was inserted, such as a Post or Category.
    AfterUpdate - DataObjectEventHandler(DataBuddyBase dataObject, EventArgs e)
    Called after an object is updated in the database. The dataObject parameter is the object that was inserted, such as a Post or Category.
    RenderPostBody - RenderPostBodyEventHandler(StringBuilder sb, PostEventArgs e)
    Called when the body of a post is being rendered (i.e. $post.Body). The StringBuilder param lets you append additional content to the end of the post body when it is being displayed. The PostEventArgs contains a PostRenderLocation enum that tells you whether the body is being written out to a Web page or RSS feed (or other).
    RenderHtmlHeader - RenderContentEventHandler(StringBuilder sb, EventArgs e)
    Called by the $macros.Head() method, which is used in the layout.view file to generate all of the HTML head elements needed by Graffiti, such as meta tags, javascript, etc. The StringBuilder param lets you append additional content in the HTML head section.
    RssItem** - RssPostEventHandler(XmlTextWriter writer, PostEventArgs e)
    Called while Graffiti is generating the item element in a RSS feed. By adding elements to the XmlTextWriter parameter your plugin can add additional elements to each RSS item.
    RssNamespace - RssEventHandler(XmlTextWriter writer, EventArgs e)
    Called while Graffiti is generating the namespaces in a RSS feed. The XmlTextWriter param can be used to add additional namespaces to the RSS feed. This is often needed when adding additional elements to the feed.

    ** Note: The RssItem event is not actually new, but the delegate changed in v1.0.1. In the initial Graffiti release it passed a RssToolkit RssItem in the params which wasn't very useful for adding additional (non-RSS-core) elements. So we changed how Graffiti generates RSS feeds to use a plain XmlTextWriter which gives more flexibility.

    In addition to the actual events listed above, there were two new virtual methods added to the abstract GraffitiEvent class, which is what all Graffiti plugins inherit from. These methods are EventEnabled() and EventDisabled(), and as you can probably guess they are called when a plugin is enabled or disabled in the Graffiti control panel. Your plugin can optionally use them to do any desired setup or cleanup tasks, such as writing out a file.

    We also added a few nifty utility classes to Graffiti.Core that plugins can use to do some pretty advanced stuff if needed. There's a new GRequest class that makes it easy to send HttpRequests and read the response. This is very similar to the CSRequest class that long been a part of Community Server. And there is a ManagedThreadPool class you can use to do long-running tasks (such as sending trackbacks) on a background thread.

    Have fun extending Graffiti!


    Tagged as graffiti , plugins

    Similar Posts

    1. Now Graffiti Powered
    2. Live Blogging the CSDC - Part 3
    3. Live Blogging the CSDC - Part 2

  • Now Graffiti Powered

    Last night I migrated this blog from Community Server 2007.1 to Graffiti. Although it might be hard to tell that at first glance because it is using a very similar theme.

    When the first batch of Telligenti jumped from CS to Graffiti a couple months ago, I had thought I would keep my blog on CS for the foreseeable future. Mostly because I've been working on CS for several years so it was hard to imagine not using it, and also for dogfooding new versions. When I first created this site back in 2004, it was running a combination of .Text and nGallery. Then I migrated to Community Server 1.0 and pretty much every alpha, beta, and stable version of CS since then up to v2007.1.

    But about a month ago I switched over to the Graffiti team here at Telligent, and the more I work with it the more I love how simple yet flexible it is. So I decided to migrate my blog, and started planning out tasks I wanted to complete beforehand:

    • I created a Graffiti version of my Gulf Coasting theme that I had written for CS 2007 last summer. You can download this theme for free from the Graffiti Marketplace that is integrated in the Graffiti control panel, and I'll put it up for download here soon.
    • To make Graffiti a top notch blogging platform, I created a Blog Extensions plugin that extends graffiti with a few advanced blogging features that we left out of the core to keep it simple. This plugin adds the ability to automatically send & receive trackbacks and pingbacks, sends blog update pings, adds a comments RSS feed, and support for GeoRSS. It's running on this site right now, and we are planning on releasing this as an official Telligent plugin in the near future.
    • To go along with the new ability to receive trackbacks (via plugin), I added support for importing trackbacks from CS to the CS 2007 migrator and some new Chalk collections that on the post page. These changes will be included in the upcoming Graffiti service pack release.
    • I wanted to keep a simple photo gallery on my site, and a short while ago Andrew Duthie sent us a sample Graffiti theme where he had added the very slick open source Slide.Show Silverlight photo gallery control. I was really impressed with how polished and configurable that control is, so I created another Graffiti plugin that embeds it and allows you to add a photo gallery to a post page. It supports photos uploaded to your web site or saved in Flickr. This plugin is also running on this site. I'll release it (with source code) when the aforementioned Graffiti service pack is available, as it requires some of the new events that were recently added to core.
    • I am using Rich Mercer's Permanent Redirect Graffiti plugin, which redirects requests to posts and tags using the Community Server format to the new Graffiti paths. It is working wonderfully, and combined with a few IIS redirects that I setup for my downloads and a few other urls, should hopefully prevent anyone from getting a 404 error on my site. Unless of course you just type some random url in.=)
    • Lastly, I am also using Jayme Davis's SkinnyWeb plugin to compress the output source for faster download times, and one that Scott Watermasysk wrote to display related posts inside the RSS feed.

    Now that my site is running on shiny new bits, I feel inspired to start blogging again. Expect lots of new Graffiti related posts and projects coming soon, and I'll try and mix it up with a few Community Server tips every now and then as well.


    Similar Posts

    1. Live Blogging the CSDC - Part 3
    2. Live Blogging the CSDC - Part 2
    3. The Gulf Coasting Debut

Powered by Community Server (Commercial Edition), by Telligent Systems