May
22
(2006)
Modules enabled on this copy of Drupal:
The colophon is a list of Drupal modules used to run this site. It’s generated by calling the module_list() method, and iterating over the output, so it’s a live reflection of what’s running right now.
-
$modulelist = module_list( FALSE, TRUE, TRUE, NULL);
- ‘.$amodule.’
- ‘.$file->name.’: ‘.$file->description.’
echo '
- ‘;
foreach ($modulelist as $amodule) {
echo ‘
‘;
}
echo ‘
‘
/**
// Get current list of modules
$files = system_listing(’\.module$’, ‘modules’, ‘name’, 0);
// Extract current files from database.
system_get_files_database($files, ‘module’);
ksort($files);
foreach ($files as $filename => $file) {
if ($file -> status) {
drupal_get_filename(’module’, $file->name, $file->filename);
drupal_load(’module’, $file->name);
$file->description = module_invoke($file->name, ‘help’, ‘admin/modules#description’);
echo ‘
‘;
}
}
*/
?>


bjorn – that’s cleaner, but moving some modules out of /modules/ appears to break them… It’d be ideal if modules had that info as part of their code – some metadata that could be queried to display info about them. This would be useful for versioning as well. A simple hash/dictionary containing name, description, url, version, etc. would suffice. Maybe this is already possible though…
I whipped together some code that will produce a page like this. Posted to the Drupal handbook at http://drupal.org/node/69941. See the extra bit about determining whether a module is core or contributed. Is there a better way to do this?
Code in use on my site at http://www.nlca.com/node/188.
-b
Useful post. And it is interesting that you have turned off the blog module and seem to be using the story module which is better suited for a single user blog.
I think Robert's point was also that the module list seems to give the impression that you *must* install all these modules to blog in Drupal, which is not the case, as you know.
D'Arcy, seems like a lot of modules just to make Drupal work like WordPress- only an uber geek like you would do this much work to make this work.
OMG that's a lot of modules! It might be interesting to point out which of the above are core modules and which you had to install yourself.
David – these modules don’t just replicate WordPress, many add stuff I never had in my WordPress blog. For instance, Search404 intercepts missing page requests and attempts to search for content based on the URL fragment to help find stuff even if the URL is wrong. Views is a funky module for generating dynamic pages from complex database queries. etc…
And I had easily this many plugins running on WordPress as well…
Robert – not a bad idea. This list is dynamically generated by asking Drupal for the list of enabled modules, then asking each module to spit out some info. Might be possible to have the module spit out “core” or “third party” as well. Ideally, links to the module project pages would be good, too, as well as version numbers…