Someone emailed me asking how to widgetize a Serendipity template. For those who don't know, widgets is the name Wordpress people use for their plugin that allows users to sort their sidebar plugins or even remove them altogether.
The Serendipity developers actually included this functionality so long ago we've probably even forgotten who orignially came up with the concept. Wordpress just copied us. And only recently as well. Now I know my loyal WP readers and friends in that community are going to flame me, but I don't care, bring it on. Ok that's not true, I do care, but bring it on anyway.
So, if you're a Serendipity user and you want to edit your templates to add that widget stuff, you don't need to, every template for Serendipity already has it built-in. Need proof, easy, just open index.tpl in one of the templates. What you're looking for is a couple of lines that look like this;
{serendipity_printSidebar side="right"}
{serendipity_printSidebar side="left"}
Porting widgetized WP templates
So if you have an idea for a template, or if you want to port a widgetized WP template, just make sure those two lines are present in the sidebar areas of your Serendipity template.
I've already written a series of articles on
porting WP themes, and if your WP theme includes widgetized sidebars, you need to replace the following Wordpress code with our Serendipity code.
<?php if ( !function_exists('dynamic_sidebar')
|| !dynamic_sidebar() ) : ?>
WP templates are a combination of php and html, and for new designers the php can look quite daunting, in fact the example above doesn't show the closing endif that would be needed in the WP theme. If you are porting a WP template and want more info on how the widgets work you could read '
widgetizing themes'.
If you enjoyed this post, make sure you subscribe to my RSS feed.