View RSS Feed

Nick's Hotaru CMS Blog

Multiple Dynamic Sidebars in Minutes

Rate this Entry
One thing I've been playing with for the last couple of days is dynamic sidebars. I wasn't planning to add such a fancy gimmick, but one thing led to another and I ended up using the Plugin Management code to make a Sidebar plugin. Basically, it enables plugin developers to make sidebar widgets which users can add to their sidebars and reorder. It allows for multiple sidebars and multiple instances of widgets.

Attachment 21

The names "Sidebar 1" and "Sidebar 2" in that screenshot are a bit misleading because they aren't sidebars at all, just separate plugins hooks which could go anywhere:

PHP Code:
<?php $plugin->check_actions('sidebar'true'', array(1)); ?>

<?php $plugin->check_actions('sidebar'true'', array(2)); ?>
Look closely and you'll see the only difference between them is the ID number in the array.

So having done that, I figured I better make a multi-column theme to demonstrate, or at least take a screenshot of, and this is what I came up with:

Click image for larger version. 

Name:	hotaru_2_sidebars_2009_08_10.png 
Views:	81 
Size:	88.7 KB 
ID:	543

The amazing thing is that it didn't take too long to add that second sidebar into the theme at all. Hotaru includes Yahoo's UI Grids CSS so all I had to do was go to the Grid Builder tool at Yahoo, choose a layout I liked and then edited the default theme's index.php file to match the automatically generated HTML from Yahoo.

I won't include this "Columns" theme into Hotaru yet, since one default theme is enough at this stage of development, but the future of Hotaru themes looks good!
Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	hotaru_sidebar_settings_2009_08_10.png 
Views:	155 
Size:	64.5 KB 
ID:	542  

Submit "Multiple Dynamic Sidebars in Minutes" to Digg Submit "Multiple Dynamic Sidebars in Minutes" to del.icio.us Submit "Multiple Dynamic Sidebars in Minutes" to StumbleUpon Submit "Multiple Dynamic Sidebars in Minutes" to Google

Comments

Trackbacks

Total Trackbacks 0
Trackback URL: