1

I want to match a page--type-receipe.tpl.php for a page type but it doesn't work. I think the reason is the multi-language.

The page.tpl.php work without any problems.

1

It doesn't work because page--type-receipe.tpl.php isn't a valid template suggestion. If you're looking to theme a page by node type & language, you can do something like this to create your own theme suggestions inside your theme's template.php.

function MYTHEME_preprocess_page(&$variables) {
  global $language;

  if(isset($language->language) && isset($variables['node'])) {
    $variables['theme_hook_suggestions'][] = 'page__'.$variables['node']->language.'__'.$variables['node']->type;
  }
}

This will let you make page--en--recipe.tpl.php a valid template file for a page showing a recipe node in english.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.