I need to have 2 separate front page tpl pages for a multilanguage site I'm building, one for the english layout and one for the chinese layout. If the default language is zh-hans, I would like it to serve the custom tpl page-cnfront.tpl.php.
I managed to find an answer to my question for Drupal 6, which provided the following code:
function mytheme_preprocess_page(&$variables) {
global $language;
if (drupal_is_front_page() && $language->language == 'en') {
$variables['template_file'] = 'page-customfront';
}
}
I tried to modify it for my site in Drupal 7 like so:
function mytheme_preprocess_page(&$vars) {
global $language;
if (drupal_is_front_page() && $language->language == 'zh-hans') {
$vars['theme_hook_suggestions'] = 'page__cnfront';
}
}
but I think something is wrong, because I get a WSOD when I add this to my template.php. What is the correct way to do this?