Bookmarklet: Collapse all Fieldsets in Drupal Module Page

Why do I need it?

This is a quick and easy way to clear the clutter on your Modules page in Drupal. One of the sites I’ve recently worked on easily had over 30 modules that were grouped in 10-12 fieldsets on the modules page in Drupal. When developing, sometimes you need to toggle modules and finding them in the mess can be difficult. (Of course, you can always just search the page. I’m too lazy.)

This bookmarklet lets you click one link, provided you’ve added it to your browser’s toolbar and quickly clean up the clutter the page.

Give me what I came for!

If you already know what a bookmarklet is and know how to use one, I’ll get right to it.

javascript:function collapseEm(){$(‘.collapsible’).addClass(‘collapsed’);}collapseEm();

How to use it

Easy. Copy the code, create a new bookmark and paste it in. When you click your new bookmark, the fieldsets should collapse.

It isn’t working for me

First, it requires jQuery, which should already be installed with Drupal. If for some reason you don’t have that, it won’t work.

Second, I use it in Firefox on the Mac. Let me know what browser you’re using if it doesn’t work.

There’s really nothing to it

I know. It isn’t complicated and you probably could have thought of it yourself. Hopefully it saves someone some time who wouldn’t have or couldn’t have.

This entry was posted in Development, Drupal, jQuery. Bookmark the permalink.

3 Responses to Bookmarklet: Collapse all Fieldsets in Drupal Module Page

  1. Parneix says:

    Hi, Nice explanations. Would you know anything about a bookmarklet which allows quick posting : something similar to the Tumblr bookmarklet?

    Thanks again,

    Parneix

  2. Fran says:

    Thought I had it! This does not work for me in Safari. Can’t figure it out. O well.

  3. Fran says:

    Oh, I got it… For Safari this works:
    javascript:(function()%20{jQuery('fieldset').addClass('collapsed');})()

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>