admin
18 October 2016
Versione Drupal
Da inserire nella funzione [THEME_NAME]_preprocess_page()
// Page template suggestions based off URL alias if (module_exists('path')) { $alias = drupal_get_path_alias(str_replace('/edit','',$_GET['q'])); if ($alias != $_GET['q']) { $template_filename = 'page'; foreach (explode('/', $alias) as $path_part) { $template_filename = $template_filename . '__' . $path_part; $variables['theme_hook_suggestions'][] = $template_filename; } } }
Per avere html.tpl.php sempre in base al path basta inserire questo codice nella funzione [THEME_NAME]_preprocess_html()
if (module_exists('path')) { $alias = drupal_get_path_alias(str_replace('/edit','',$_GET['q'])); if ($alias != $_GET['q']) { $template_filename = 'html'; foreach (explode('/', $alias) as $path_part) { $template_filename = $template_filename . '__' . $path_part; $variables['theme_hook_suggestions'][] = $template_filename; } } }