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


Translating Menus in Drupal 6

menu translation administration screenFor well over a year Drupal core has supported much more advanced multilingual capabilities compared to previous versions. When Drupal 6 landed all the hard work that Gábor Hojtsy and the internationalization team did was released to the world and people rejoiced (in 60+ languages).

This is a very broad simplification of what was done, but the focus of those efforts was to make it easier for administrators to translate content (nodes) on a site. If you have a news story published in English you can create a French version of that news story that is 'tied' to the English story and it will be easy for your site visitors to switch between the English and French (or Spanish or Dutch etc.) version of your story.

As I said, this is a very broad simplification. There was much more work being done, but not all of it managed to make it into core. Some translations features were left in the contributed i18n (internationalization) module. Others features were 'roughed in' to core to allow for future improvements.

One such feature that didn't quite get finished was menu translations.

Menus can be translated, but its not entirely obvious how to do it. And even after you've read the documentation, it may not necessarily work the way you expect it to. (See example: Menu items disappear when you change language in the Drupal handbook.)

April 14th 2009 11PM
By: andre

Syndicate content