I want to have custom article type page theme thats why i created page--node--article.tpl.php but its not working i have cleared all cache but still its not working.

Comments

shadcn’s picture

To override the node you should use node--article.tpl.php. To override the whole page, you need a custom preprocess function to add the template suggestion first.

function themeName_preprocess_page(&$vars, $hook) {
  if (isset($vars['node'])) {
    $vars['theme_hook_suggestions'][] = 'page__'. $vars['node']->type;
  }
}

Then use page--article.tpl.php as the template file name.

Rajatarora’s picture

Thanks
It worked

jaimeah’s picture

Years may pass, but it still works like a charm.

Thank you for your this.

Antonio Hernandez