Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hi,
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 :
<?php
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
?>
Comments
Comment #1
dimmech CreditAttribution: dimmech commentedTry process instead of preprocess:
Comment #2
timos CreditAttribution: timos commentedHi
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)
cheers
Comment #3
SteveK CreditAttribution: SteveK commentedI've added this to the 7.x-3.x branch inside the preprocess_page() function. Tested and works.