Last updated 27 September 2011. Created on 7 July 2009.
Edited by JuliaKM, pawel.traczynski, joshmiller. Log in to edit this page.

To collapse all of the field groups on the modules pages:

1) Create a new block with the block body:

<script language="javascript">
$(document).ready(function () {
  $("form#system-modules fieldset.collapsible:not(.collapsed) .collapse-processed a").click();

2) Set the Input Format to "Full HTML" or "PHP code."

3) Under "Page Specific Visibility Settings", select "Show on only the listed pages." and enter the path:


4) Assign the block to appear in a region that will apear as part of your admin/build/modules/list page.

Learn more about jQuery in Drupal at

Looking for support? Visit the forums, or join #drupal-support in IRC.


aniediudo’s picture

You can also do this via the settings page of the Admin Menu contrib module. I would strongly advise newbies to embrace this module. It could save you a whole lot of clicks, page loads & headaches, esp. if you have a crawling internet connection like mine!

giuseppe pillera’s picture

This tips is very useful!! Thank u very much! I was becoming almost idiot to search and search in my modules adm page!

ñull’s picture

I would like to use the same method to close one check out pane of Ubercart, but this code does not work (any more). Any clue why?

eaposztrof’s picture

I created a custom module with the following code in .info file:

name = eaposztrof_hacks
description = Custom alterations for admin pages on my website
core = 7.x
stylesheets[all][] = css/eaposztrof_hacks.css
scripts[] = js/eaposztrof_hacks.js

and adding the following jQuery code to the js/eaposztrof_hacks.js file:

(function ($) {
		if(window.location.href.indexOf("admin/modules") > -1) {
			var els = [].slice.apply(document.getElementsByClassName("collapsed"));
			for (var i = 0; i < els.length; i++) {
				els[i].className = els[i].className.replace(/ *\bcollapsed\b/g, "");