preprocess
Drupal 7 notes: node or page template by path
Tuesday, 5 February 2013 @ 6:55pm
Because I always seem to manage to completely forget how to do something this basic.
template.php in theme_preprocess_page(&$variables) or theme_preprocess_node(&$variables)
<?php $path = drupal_get_path_alias(); if (strpos($path, 'part_of_url') !== false) { $variables['theme_hook_suggestion'] = 'page__whatever'; // or node__whatever if using in a node preprocess } ?> This work has been marked as dedicated to the public domain