Skip to main content

A quick&dirty taxonomy based css loader

Senior Developer
Dec 01, 2008

I had to implement a multiple colored theme for one of our sites. The site is a small company site with few static pages and a gallery. I know that there are several modules that can implement this feature, but I didn't want to install extra modules. So I added following few lines to the template.php file from my zen-based theme:

[gist:4135387] This a very tiny but powerful function. All you have to do is to create a vocabulary, and assign some terms for it. After that create some css files with the terms' name in your theme folder. Finally add this function to your template.php file, and call it with the vid of the theme-changer vocabulary. Enjoy :)

Tamás is responsible for the development and design of custom Drupal modules and back-end solutions. He's a self-taught programmer, with his main focus on Drupal, Go and iOS development. Besides programming languages, he's interested in distributed computing, computer graphics, image processing and security. He has a couple of contributed modules on Drupal.org, and he completed the Summer of Code at Drupal in 2010 and 2011. His bigger projects at Pronovix include participating in Drupal Gardens development, helping to create sites for Warner Music Group, Pfizer and Florida Hospitals. He did performance optimizations on Qatarliving. He's one of the main contributors to the Brightcove module used by large Drupal sites worldwide.

Newsletter

Articles on devportals, DX and API docs, event recaps, webinars, and more. Sign up to be up to date with the latest trends and best practices.

 

Subscribe