Customizable Plugin Sidebar locations

For ages, Serendipity has given users the flexibility to move around plugins in the left/right sidebar. Two sidebars were a usual concept for blogs in the days past, and for surely some more days to come.

But some themes, like the Hemingway theme give people a different approach to surrounding their blog content. The result of a porting discussion on the forums lead me to patch our plugin API.

Serendipity 1.1 already support custom theme options (like special navigation bars, colorsets etc.), and what came out of my recent patch is the functionality to define multiple custom sidebars.

With this, you can add a "top", "bottom", "middle" or whatever else sidebar locations to your themes, and put them in the smarty templates using the function {serendipity_printSidebar side="XXX"} wherever you like.

It's as easy as adding a config.inc.php file to your template, add a $template_config array value like this:

       
$template_config = array(
     array(
       'var'     => 'sidebars',
       'title'   => 'Sidebars',
       'type'    => 'string',
       'default' => 'left,hide,right,bot'
     )
);
(or modify existing config arrays) and save the file. When you now enter your plugin configuration section, you will see each of the sidebar locations next to another, so that you can move around plugins from one to the other location.

There are two things to watchout: If you use locations other than 'left' and 'right', other templates may not output plugins that were put to a location like 'bot'. So if you switch templates, you must watch out on where you put your sidebar plugins into.
The other thing to pay attention: Only use "," to separate the sidebar item names (no spaces!) and never use more than 6 characters for your locations.

Please have a test with these new possibilities, tell us if you like it, and show us the results you made with it!

This functionality has been implemented into recent Serendipity 1.1 nightlies (currently 1.1-beta4)

Trackbacks

Trackback specific URI for this entry

  • No Trackbacks

Comments

Display comments as (Linear | Threaded)

Carl on at :

I've trialled this update and it really is as simple to configure as Garvin has stated. By adding this function, Garvin is effectively saying to us all, forget about Serendipity as just a blog tool, now we're a full CMS!

CoSTa on at :

wheee! it WORKS! like a charm...
this is what i call flexibility. man, this functionality kick ass. i'm playing with it right now and i'm totally into it. small revolution in serendipity templating garv :). thanks!

deborah on at :

Blog molto interessante

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

BBCode format allowed