Using module_list() to show active Drupal modules
This code can be used in a custom module, a template.php file, or most easily in a block. This looks good in the header bar on a demo site, without a title, as you can see in the screenshot! The reason I am using this is because I do a lot of Drupal demos and it’s great to have the active modules showing so there is no question of what’s required to do whatever it is I am showing. The list of modules is ordered by weight, then filename, which makes it easy to determine if your custom modules are running at the right times.
1 2 3 4 5 |
<?php $modules = implode(', ', module_list()); print '<font style="font-size: 9px; line-height: 18px;">'; print "<strong>Active Modules: </strong>{$modules}</font>"; ?> |
Screenshot of the block displayed in the sites header region: