roboform


Spam: Don't buy it!

Bloggers' Rights at EFF

It’s all about Widgets these days


Published Sunday, April 16th, 2006 at 2:55 pm
Sidebar Arrangment

So as a WordPress fan I’ve been hearing a lot about Widgets these days. What are widgets?  Well if you look to the right side of my blog you will several items running vertically down the page.  This is the side bar.  You will notice that the side bar is made up of discrete segments.  Normally these segments are setup by hand in the WP template system.  What the widgets plugin does is provide a system where each items is a separate entity and the side bar can be arranged and rearranged by dragging and dropping the widget elements.  The end result is the same look to the website visitors but a much easier time on the developers end maintaining the side bar.  New plugins will start coming along that are widgetizid.  That is the plugin will come with a prepackaged widget that can be added to the sidebar with a simple drag and drop.  That is the great thing about WP… while you can make a website all by hand the templating and plugin system makes it a easy to avoid coding all together.

So with all this talk I’ve been hearing about Widgets yesterday I decided to give it a try.  The new widgets plugin is available from Automattic.    Setting up involves uploading the plugin, activating the plugin, and modifying your theme.  The Automattic website has details on this so I won’t go into them here.  Next you have to setup the individual widgets.  You can drag and drop several preexisting widgets to the sidebar but I found they don’t fully suit my needs.  For example, the links widget is an all or nothing thing.  That is, if you place the links widget in your sidebar you will get a list of all links across all categories.  There’s no option to select which categories to display.  But that is the great thing about using widgets; all you need to do is find where someone has made a widget that suits your needs.  So a little searching turned up the Linkblock widget.  With this you can add individual link categories to the sidebar.  That helped a lot but still not perfect.  Some of my links (for example blogs) are not displayed in the default way.  Linkblock widget will display the links for a single category in the default manner for that category.  On my side bar I manipulate the links call in to modify what links are returned; for example to limit the number of links or modify the sort order.  So for these cases I needed the ExecPHP widget.  This allows me to execute PHP code from within a widget.  With this plugin I was able to get the side bar looking almost exactly the way I wanted with the added advantage of easy manipulation on my end.

Overall I think the widgets plugin is a great addition to the WP system and I hope they eventually include it in the WP core.  One improvement I’d like to see is the ability to name the widgets inside the widget drag and drop system.  It can be difficult to arrange widgets if they all have generic names like “Text 1″, “Text 2″, etc.  I also hope someone improves on the Linkbot widgets (or the default links widget).
 

3 Responses to “It’s all about Widgets these days”

  1. I agree with you about the widget naming issue, however the point of widgets is to use a bunch of different ones. The Text widget was never really intended for HTML, for example, although a lot of people are using it for that. And the ExecPHP widget I wrote was only intended as a stopgap measure, to help people convert their existing sites rapidly. Hopefully you’ll switch away from using the ExecPHP widget as more and more widgets get developed by plugin authors. It’s better to use an actual widget for a plugin than to use the ExecPHP widget to turn anything into a widget, basically.

    So as more and more widgets are actually developed, I think the naming issue will become a moot point, since each widget will have it’s own name anyway. 

  2. I agree… I hope that the built in links widget or the Linkblock widget will improve to the point where I don’t need the ExecPHP widget.  As for the naming… I still think it should display something more useful then “Text 1″, “Text 2″, “RSS 1″, “RSS 2″.  When I’m rearranging my sidebar I have to click to edit it just to see what it is I’m dragging and dropping.  At the very least using display the title for widgets that support titles.

  3. Excuse me if my english is bad (I’m french). I’m looking for the plugin execphp wich isn’t available left at http://ottodestruct.com/blog/2006/04/09/fun-with-widgets/. Could you send it to me by mail please ???

Leave a Reply