As reported in Drupal 7 Template Suggestions, the template suggestion used by default from Drupal 7 for pages is page--[front|internal/path].tpl.php.
For a page visible at http://www.example.com/node/1/edit, Drupal would look for the following template files:
- page--node--edit.tpl.php
- page--node--1.tpl.php
- page--node.tpl.php
- page.tpl.php
To add extra suggestions, your theme should implement template_preprocess_page() and add new suggestions in $variables['theme_hook_suggestions']
($variables
is the variable passed by reference to the function).
If you did that, then the only reason the suggested template file is not being used is because the file is not correctly named: in the case the page shows a book page, for example, the template file should be page--book.tpl.php. You could change the code for your theme, and let it use the page--node-type.tpl.php template, if it doesn't find a template like page--book.tpl.php.
To notice also that, in theme_get_suggestions() (which is the function called by template_preprocess_page()) hyphens are replaced by _
, and not vice versa.
The reason that is done is explained in a comment reported in the function code.
// When we discover templates in drupal_find_theme_templates(),
// hyphens (-) are converted to underscores (_) before the theme hook
// is registered. We do this because the hyphens used for delimiters
// in hook suggestions cannot be used in the function names of the
// associated preprocess functions. Any page templates designed to be used
// on paths that contain a hyphen are also registered with these hyphens
// converted to underscores so here we must convert any hyphens in path
// arguments to underscores here before fetching theme hook suggestions
// to ensure the templates are appropriately recognized.
$arg = str_replace(array("/", "\\", "\0", '-'), array('', '', '', '_'), $arg);