Community

Scalability of sub-themes on multilingual websites

Hello,

I am currently maintaining a multilangual website with one, identical design that handles about 10 different languages. Each website is being managed by a dedicated team from a specific country - they add their own, unique content, they also want their own, unique fixes/improvements etc. so it's not possible to make one, universal template and add/edit/delete content only - all layouts are partially customised for specific teams.

Right not each variant has it's own copy of the whole template with all the files. It's completely inefficient since even small modifications that must be added to each language takes forever to implement and spread along all the websites' versions.

Using sub-themes that inherits all the files from basic theme looks like a good idea to solve most of my current issues. I've read about it, played with it for a while, checked how does inheritance works and tested it. I've also downloaded Zen, just as I always do since it's a great starter theme - but I started to wonder if it really should be used in my situation. Even Zen's guide says not to modify any file from basic theme.

I've got a question for any developer with experience in theming.
Is it better to use a starter theme like Zen and greatly modify it when creating basic themes to use inheritance functionality or to start with a blank project and create everything from scratch? What is more efficient and yields more future benefits?

Comments

Is there anyone who

Is there anyone who experienced a similar issue in the past?

Many ways to skin a cat

The idea with Zen, or Adaptivetheme, Omega, Fusion etc is to create a sub-theme that would hold all the global styles for all sites. Then create sub-sub themes for each language site which holds only the customization's for that site. For example

- base theme
-- custom subtheme
--- language specific sub-sub theme

As you can see you never edit the base theme, you should not do that unless you really know what you are doing - its not illigal to do so and you can do it. The main reason people say not to is for upgrades - frankly I think that's a crock and you should never upgrade a base theme (they often change too much to screw up your sub-themes) unless it's a security issue.

That is one way to do it, especially good if you need to customize templates or theme functions etc. However, its not the only way. For example if the customization were CSS only, then you could quite easily create a function that loads a special CSS file only for a particular sub-site - meaning you have only one theme (or one sub theme if using a base theme) that serves all sites. The CSS file is loaded programmatically by the main theme, so in that one main theme you would have files such as:

mysite-english.css
mysite-french.css

And so on, these load only for the language specific sub-site.

Another way would be to generate a body class for each sub-site and use that for overrides. Adaptivetheme does this by default, loading a body class based on the site name.