Template suggestion being ignored I have a parent theme as a basis for a multisite installation. Right now, I'm working on a child theme which has to have some custom templates. Here's my preprocess function in my child theme:

$orig = $vars['theme_hook_suggestions'];
$manual = array('page__node', 'page__node__%', 'page__node__96', 'page__gallery', 'page__drisco_gallery');

dpm(array_diff($manual, $orig));
dpm($manual);
dpm($orig);
$vars['theme_hook_suggestions'] = $manual; // Loads my page--gallery.tpl.php template and works as expected.
$vars['theme_hook_suggestions'] = $orig; // Ignores my template, just uses page.tpl.php


The template only loads if I create the array by hand, even though it's apparently identical to the one already there. Here is what dpm() outputs:

... (Array, 0 elements) 

... (Array, 5 elements)
    0 (String, 10 characters ) page__node
    1 (String, 13 characters ) page__node__%
    2 (String, 14 characters ) page__node__96
    3 (String, 13 characters ) page__gallery
    4 (String, 20 characters ) page__drisco_gallery

... (Array, 5 elements)
    0 (String, 10 characters ) page__node
    1 (String, 13 characters ) page__node__%
    2 (String, 14 characters ) page__node__96
    3 (String, 13 characters ) page__gallery
    4 (String, 20 characters ) page__drisco_gallery


Does anyone have a clue of what I'm doing wrong?
In order to load the template based on the content type, inside the template.php file of your theme you need the following code:

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


if the content type is "mycontent," create the page--mycontent.tpl.php file.  

For template files that are based on the page path, create the page--front.tpl.php, page--node--7.tpl.php, page--node--58.tpl.php or page--node--nodeid.tpl.php files. Please note that between the page and node templates are different from what they used to be in drupal 6.