Multiple Dynamic Sidebars in Minutes
by, 08-10-2009 at 04:48 AM (1389 Views)
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.
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:
Look closely and you'll see the only difference between them is the ID number in the array.PHP Code:
<?php $plugin->check_actions('sidebar', true, '', array(1)); ?>
<?php $plugin->check_actions('sidebar', true, '', array(2)); ?>
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:
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!
Total Trackbacks 0