Articles


How to write a page tpl file for a node type?

How to write a page tpl file for a node type?



Posted bysivaprasad,22nd Jul 2016

Add this code to your theme template.php


function theme_preprocess_page(&$variables) {
  if (isset($variables['node'])) {

    $variables['theme_hook_suggestions'][] = 'page__node__'. $variables['node']->type;

  }
}

Then create a tpl file page--node--'name'.tpl.php

Related Articles