knackforge
January 24, 2014
Let's come to the heart of the topic, by reading the above explanations you would have obtained a pinch of salt about the real scope in using page.tpl.php and hook_preprocess_HOOK.
Now do the following:
In active theme's template.php file add the below hook_preprocess_page() implementation,
function my_theme_reprocess_page(&$variables, $hook) {
if (isset($variables['node']->type) && !empty($variables['node']->type)) {
$variables['theme_hook_suggestions'][] = 'page__node__' . $variables['node']->type;
}
}
Now page--node--article.tpl.php
, page--node--page.tpl.php
, etc. will be our per node tpl.php page.
Of course, to be created by forking page.tpl.php, will help you to have a different page structure based on the content type.
Just like how your fellow techies do.
We'd love to talk about how we can work together
Take control of your AWS cloud costs that enables you to grow!