Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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();
});
</script>
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:
admin/build/modules/list
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 http://drupal.org/node/301181.
Comments
Admin Menu gives you this as well as much more
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!
This tips is very useful!!
This tips is very useful!! Thank u very much! I was becoming almost idiot to search and search in my modules adm page!
Why doesn't it work (any more)?
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?
Collapse Fieldsets on Modules Admin using a custom module
I created a custom module with the following code in .info file:
and adding the following jQuery code to the js/eaposztrof_hacks.js file: