I am developing a Drupal theme from scratch, and I have run into some trouble with template suggestions. Using the solutions discussed on Drupal support, I created a template.php file and included this code:
function stronger_preprocess_page(&$vars) {
if (isset($vars['node'])) {
$vars['theme_hook_suggestion'] = 'page__'.$vars['node']->type; //
}
}
This has allowed me to successfully use page--nodetype.tpl.php template files, but I am also randomly seeing errors such as:
Notice: Undefined variable: node in include() (line 24 of /Applications/MAMP/htdocs/strong-local-final/sites/all/themes/stronger/page.tpl.php).
I have read elsewhere that the node variable needs to be re-declared, but I am unsure of how or where to do this. Any help or references would be greatly appreciated!