i'd like to know if there is any reason about the no usage of theme_hook_suggestions in the preprocess_page function.

In the 6.x versions, the theme offers the ability to override the page.tpl.php file with node type support, and it seems easy to reproduce that on the 7.x versions with the theme_hook_suggestions system.

what about code below :

function basic_preprocess_page(&$vars, $hook) {
// content of the function
  if (isset($vars['node']) && $vars['node'] -> type != "") {
    $vars['theme_hook_suggestions'][] = 'page__type__' . $vars['node'] -> type;
// end of the function


dimmech’s picture

Try process instead of preprocess:

function THEMENAME_process_page(&$vars, $hook) {
timos’s picture


Thanks for answer.

Actually the code i mention above works. Why do you think it is better to do that in a process function than in a preprocess function ?

My issue is about integrate this feature in the basic theme (as it was in the d6 version)


SteveK’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Active » Closed (fixed)

I've added this to the 7.x-3.x branch inside the preprocess_page() function. Tested and works.