Skip to content Skip to navigation

March 2011

Creating a Page Template Suggestion for a Specific Node Type in Drupal 7

Add the following function to the template.php for your theme:

function yourthemename_preprocess_page(&$vars, $hook) {
 if (isset($vars['node'])) {
 // If the node type is "blog" the template suggestion will be "page--blog.tpl.php".
  $vars['theme_hook_suggestions'][] = 'page__'.$vars['node']->type;
 }
}

 
Change the "yourthemename" in the function name to match the name of your theme.


News in the 21st Century

(timings are approximate)
Hour 0: news is created/disseminated from the source

Hours 0-30: people with a direct interest micro-blog (Tweeting, fb-status, etc.), text, and blog about it.

Hours 12-48: people with a secondary interest micro-blog, text, and blog about it.

Hours 24-72: dinosaur print and broadcast media start to disseminate the story.


Pages