it’s got a widget

As part of our content strategy we have to deliver and syndicate our content in a number of different ways as well as consume and represent other peoples content. Most good content management systems create RSS feeds, we use WordPress for a number of our sites and RSS feeds are created by default, however sometimes you need or may want to offer more than a simple feed, in this scenario some people offer “widgets”.

I have now been on both sides of this process, as a consumer of feeds and widgets and now as a developer. I have already used other website widgets for example YouTube, Vimeo and Google Maps to enhance our News centre website, as well as a school website.  I have created a widget for our content on our News Centre site (currently in beta testing).

The process of embedding a widget into a website is usually very easy, you get the code, put it in to your page and you are done.

I was recently asked to include the Flood Warning widget from the Environment Agency into our News Centre website. I thought this was going to be one of those easy tasks, take the code, insert into site and hey presto! – but No, it wasn’t that simple. Sadly their widget was a fixed size and that really didn’t fit with our site layout.

So instead of settling for a widget which looked out of place on our page. I set about creating my own version of their widget in WordPress using PHP and Simplepie RSS aggregator.

The Environment Agency like many other sites provide RSS feeds to the same content that is displayed in the widget. So I simply took the RSS feed to recreate the widget in the size and shape (kept the overall design the same) that we required and also included a couple of other functions like “disappear” when there aren’t any warnings. Also I decided to combine weather warnings from the Met office website to add value and additional context.

The Met Office has a couple of good widgets and they are of different sizes, but they provide a lot of information which is not what I required. So again using the RSS feed from the Met Office I created a widget that only displays if there is a weather warning.

One of the issues we saw in consuming other peoples widgets is that as we start to move toward a responsive framework the fixed sized widgets won’t work. So in the meantime we will look at creating some which fit with our framework and start conversations with other organisations around responsiveness.

Before After

Tim Barrett

I am a frontend developer for Devon County Council. I work mainly on WordPress and PHP.

More Posts

Follow Me:
Google Plus

2 comments on “it’s got a widget

  1. Good stuff, Tim. But, I can’t help thinking where is the RSS button for this blog?! (Yes, I can guess the feed url, but not evryone can.)

    I’ve had similar issues with the flood and weather widgets for our site and had to hack about with the Javascript. Our internal policies make it difficult to use php or tools like Simplepie. :-(

    Pete

    • Tim Barrett on said:

      Thank you for your comments Pete, this site is a work in progress and we always appreciate feedback. I have now added a RSS feed link to our blog.

Leave a Comment

Your email address will not be published. Required fields are marked *

Comments are held for moderation. House rules