Sidebar Widget Collapser Released

At long last, and after numerous requests, I’ve packaged up the plugin I wrote to add those collapse and expand links to my sidebar widgets.

The basic idea is that (if javascript is enabled) a script will run after the page loads that will go through your sidebar and add collapse and expand links to their titles, which will serve to show and hide any particular item. It will also remember their collapsed and expanded states for you via cookies.

The reason for doing it this way (as opposed to a server-side modification to the sidebar plugins) is that the collapse and expand links should not be added in the first place if the browser doesn’t support scripting, since their functionality is completely script dependent. Because this method uses javascript to modify the document and add the links, it will only add them when they would be able to function.

One Trackback

  1. [...] FreePress Blog » Blog Archive » Sidebar Widget Collapser Released [...]

6 Comments

  1. Posted February 12, 2007 at 8:34 am | Permalink

    Please could you add selecting the ID of the sidebar as an option? Mine happens to be called “navibar”, so I edited hte plugin.

    My theme did not have titles classed as “widgettitle”, so I modified it, but even after that, I could not get your plugin to work.

    Also, I note that the plugin expects to be in a folder called “freepress”, according to the PHP file, yet there is not mention of this (and it does not come in such a folder in the tar.gz file).

    Thanks for sharing, and I hope these comments are of use. I will be happy to try the next version.

  2. Posted February 12, 2007 at 10:12 am | Permalink

    Good catch. I will make those adjustments soon.

  3. Posted February 12, 2007 at 11:52 pm | Permalink

    Doesn’t work with my theme :(

  4. Posted February 13, 2007 at 12:43 am | Permalink

    emre & au8ust - Thanks for the feedback.

    emre - The issues you mentioned have been addressed in the latest release I just posted (version 2.5).

    au8ust - Hopefully these changes will pertain to your configuration as well. At first glance, (looking at the source of your page) it looks like your sidebar ID is different, which you can now adjust for in the plugin option panel.

  5. Posted February 13, 2007 at 11:58 am | Permalink

    I am having issues with it workin in the Anaconda theme as well. Is there a list of specific themes that it works with?

  6. Posted February 13, 2007 at 1:37 pm | Permalink

    Jose:

    There are no particular theme requirements. However, this plugin is designed to only operate on sidebar widgets, which it does not appear that you are using (at least as far as I can tell in viewing the source of your page that you linked to in this comment).

    The first thing to check is whether you have enabled the “Sidebar Widgets” plugin (by Automattic, Inc.). If you’ve got that enabled and are using it to manage your sidebar items, those sidebar widgets will have certain properties (list items with the class of “widget”, titles with the class of “widgettitle”, etc.)

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*