Skip to content

Instantly share code, notes, and snippets.

@rattlion
Created July 3, 2012 19:56
Show Gist options
  • Save rattlion/3042542 to your computer and use it in GitHub Desktop.
Save rattlion/3042542 to your computer and use it in GitHub Desktop.
// Provide additional template suggestions.
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;
$template_filename = $template_filename . '-' . $variables['node']->type;
$variables['template_files'][] = $template_filename;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment