Created
September 18, 2012 15:27
-
-
Save emjayess/3743754 to your computer and use it in GitHub Desktop.
[re]define preprocess hooks for theming individual views, displays, fields, rows, etc...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// somewhere in themes/best_theme_ever/template.php | |
/** | |
* Implements hook_preprocess_views_view | |
*/ | |
function bte_preprocess_views_view(&$vars) { | |
if (isset($vars['view']->name)) { | |
$view_preproc_by_name = 'bte_preprocess_views_view__'.$vars['view']->name; | |
// | |
if (function_exists($view_preproc_by_name)) { | |
$view_preproc_by_name($vars); | |
} | |
} | |
} | |
// somewhere else in themes/best_theme_ever/template.php | |
/** | |
* Implements preprocess for 'news' view | |
*/ | |
function bte_preprocess_view_views__news(&$vars) { | |
// preprocess operations... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
via evolvingweb.ca blog post