SIDEBAR WIDGETS PLUGIN AUTOMATTIC, INC. MARCH 2006 WHAT IS THIS ALL ABOUT? It's called Sidebar Widgets because it allows you to move things (widgets) around, in and out of your sidebar. A widget is something that you might want on your sidebar, such as a category list or the most recent comments or a link to your admin pages. There is even a widget that lets you type whatever you want in the sidebar, such as some HTML or Javascript code. HOW DO I INSTALL IT? First you have to put the files where they belong. We recommend putting all of the php script files in wp-content/plugins/widgets and keeping any new widget plugins there unless another location is specified. Here it is in graphic form: - wp-content - plugins - widgets | delicious.php | gsearch.php | rss.png | widgets.php - scriptaculous | builder.js | controls.js | dragdrop.js | effects.js | MIT-LICENSE | prototype.js | scriptaculous.js | slider.js \ unittest.js - themes - classic | functions.php (optional) \ sidebar.php (optional) - default | functions.php (optional) \ sidebar.php (optional) It will also work if you place the scriptaculous directory in wp-includes/js. It will also work if you store the RSS icon in wp-includes/images. It's pretty flexible. Installing the plugin files isn't enough, however. You must have a theme that supports sidebar widgets. To help you with that, we've included updated files for the WordPress 2.0 Default Theme (Kubrick) and the Classic theme. There are many themes that rely on Classic's script files, so it's probably a good idea to install the new Classic files unless you have modified the theme yourself. Don't forget to activate the Widgets plugin. I HAVE INSTALLED AND ACTIVATED THE PLUGIN. NOW HOW DO I USE IT? Assuming you chose the Kubrick theme, you should now see a "Sidebar Widgets" item in the Presentation menu. This gives you a screen with two columns: a palette and a sidebar. The palette has all of the available widgets and the other column represents your sidebar. You can drag the widgets between the columns to create the exact combination that pleases you and your visitors. If you find that the widgets are not draggable, there are two likely causes: you installed the scriptaculous files in the wrong place, or your web browser is not running the scripts. Some of the widgets will have a little icon on the right side of the draggable widget device. Click that icon to reveal that widget's options. Click the X or the area outside the options box to return to the widget page. Your options are not saved until you click "Save changes" on the widget page. Two of the included widgets, Text and RSS, can be replicated several times. Below the palette you will find forms to change the number of Text and RSS widgets available. Reducing the number will only cause the extra widgets to be removed from the visual interface; the contents of the widgets is preserved. WHAT IF I DON'T LIKE KUBRICK? You should. He was a visionary film producer. You are entitled to your opinion, however, so we'll give you a little tutorial on fixing up other themes. HOW DO I FIX UP MY THEME? First you have to ask yourself, "Do I know anything about my theme? Does it use an unordered list to create the sidebar?" (If you can't answer that, you'll need in-depth help on this task and that means either paying somebody a lot of money. Better yet, you can learn HTML. Sorry, we don't teach that here.) Here is an example of good sidebar markup: Notice that the entire sidebar is an unordered list and the titles are in

tags. Not every theme is built this way and it's not necessary to do so, but it's the simplest, most common, most semantically correct and the most widget- friendly sidebar markup there is. The element with id="links" is the equivalent of one basic widget. When activated, the Dynamic Sidebar plugin gives you a few functions to use in your template just like template tags. These functions let WordPress replace your theme's sidebar with a dynamic one while still falling back on the old sidebar in case you deactivate the plugin or remove all the widgets. Here is an example of a basic sidebar upgrade using the same markup as above: See? We just added two lines to the template and now it'll display a dynamic sidebar if possible, otherwise display the old sidebar. Disabling the plugin or removing all the widgets from the sidebar in the admin interface will cause the old sidebar to be displayed. Now there is one more thing to be done to the theme. Assuming you are using WordPress 2.0 or higher, this change will be made within functions.php in your theme's directory. (WordPress 1.5 users: we don't encourage people to use WordPress 1.5 anymore, so you won't find any help here. We don't even know if it's possible because it hasn't been tested.) Here is an example of functions.php for a theme that does not yet have such a file (no blank lines at the beginning or end of the file, please): That's it, just four lines. This code tells the plugin that your theme will need exactly one dynamic sidebar. At this point, your admin interface should have an extra item in the Presentation menu: Sidebar Widgets. Try dragging some widgets from the palette on the left into the box marked Sidebar 1 and saving your changes. Got it working? Fantastic. MY SIDEBAR ISN'T A LIST. WHAT DO I DO? We knew you'd ask that. You'll have to discover your sidebar's design pattern, then use some extra parameters to tell the plugin how to format them to work with your theme. We'll work through one example. Here's the original markup: Yes, we've seen markup like this. It's the second most common sidebar design pattern, which is why we chose it for the example. The first difference is that the sidebar is not built inside a