A Colophon for Drupal

A Colophon for Drupal

I wanted to put together a colophon for my Drupal site that would show the current installation details—pulling the information from the live site rather than relying on me to remember to update it after each change. With one module, three views, and a tiny bit of PHP and JavaScript, it’s now working.

Module needed: Views System (and any dependencies not yet installed).

Put the code snippets below in blocks, make the views described below as blocks also, then mix together on a page. Voilà!

Code to obtain Drupal version:

<?php print VERSION; ?>

Code to obtain paragraph font:

<p id="fontnameforcolophon">not determined</p>
<script type="text/JavaScript">
(function() {
   var elem1 = document.getElementById("fontnameforcolophon");
   var style = window.getComputedStyle(elem1, null);
   elem1.firstChild.nodeValue = style.fontFamily;
})();
</script>

View to display themes in use:

fields: System: Display name, System: Base theme (Base theme)
filter criteria: System: Type (=Theme), System: Status (Enabled)

View to display core modules:

fields: System: Display name, System: Project
filter criteria: System: Status (Enabled), System: Drupal core (Yes), System: Type (=Module)

View to display additional modules:

fields: System: Display name, System: Project
filter criteria: System: Status (Enabled), System: Drupal core (No), System: Type (=Module)

Tags: