I have a view that lists a bunch of nodes of a certain content type. I want to style this list of nodes in a way that I can't do easily with the standard node.tpl.php that they're being rendered with. I'm trying to override my themename_preprocess_node function to add a template suggestion depending on what view the nodes were called from. I tried this:
<?php
function themename_preprocess_node(&$variables)
{
// Add theming based on view name. If the view is named
// 'featurefront' one of the template suggestions will be
// 'node-view--featurefront.tpl.php'.
if (isset($variables['view']))
{
$variables['theme_hook_suggestions'][] = 'node_view__'.
str_replace('_', '--', $variables['view']->name);
}
}
?>
but it doesn't work because $variables['view'] isn't ever set anywhere. Basically my question comes down to this:
What variable can theme_preprocess_node use that will tell it the name of the current view or whether it was called from a view at all?