Language Based Stylesheet Switching in Your Theme

multilingual DrupalTheming in Drupal is the one layer that seems to have shown the most steady improvement since the introduction of phpTemplate around version 4.5. With each new release it gets easier and easier to bend Drupal to your will and have it display a pixel perfect version of your design.

In Drupal 6 we saw the introduction of powerful .info files that you can use to tell the theme system more about your specific theme. Things like its name, whether its a subtheme, what core Drupal system variables it supports, which features are configurable and which style sheets to use and load for different media.

By defining which style sheets to load in the .info file you don't need to know any PHP (or where you'd use that PHP) to include several style sheets into your site's pages. This really is a great feature. But, what if there are situations when you don't want those style sheets to show up? Or you'd rather have different style sheets load? Well, in those situations you're still going to have to get familiar with some PHP, Drupal's preprocess functions and drupal_get_css().

May 6th 2009 12AM
By: andre

Syndicate content