Mashing up Drupal themes Colourise and Acquia Slate

Today I started mashing up the Acquia Slate theme with the Colourise theme and managed to port the Acquia slate implementation of taxonomy terms into Colourise. In addition I implemented a configurable theme registry rebuild flag and added a configurable taxonomy term separator into the theme:

  • The configurable theme registry rebuild flag will bypass the Drupal theme cache when enabled. This will force Drupal to parse all template files upon every single page load. The advantage is that you can easily tweak your template since the changes are visible after each page load. However this feature will significantly slow down your Drupal environment - there's a reason why the theme registry is cached Wink
  • The Acquia Slate theme will display taxonomy terms as per vocabulary lists instead of one big tag list. In addition you can choose which vocabularies to display and which to hide, on a global level but also per content type if needed. This way it somehow duplicates the Term display module, but does in principle not require anymore extra theming work.

The trickiest part was playing around with the PHP code for the theme settings form (the file ‘theme-settings.php’ in your theme directory) and how to propagate this correctly into the template (the file ‘template.php’, ‘page.tpl.php’, ‘node.tpl.php’ and other PHP template files in your theme directory).

The code for writing those Drupal template settings forms is very verbose, and rather hard to read if you're not used to, but you must get across it if you're considering writing your own configurable theme.

The devel module and Firebug are again your best friends Wink

Olivier Biot's picture

Devel module already provides theme registry rebuild on demand

Instead of coding this in your theme, install the devel module, and then enable the devel block (admin/build/block). On the devel block, click ‘Devel settings’ (admin/settings/devel) and tick ‘Rebuild the theme registry on every page load’. Save and you're done.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.