I'm trying to implement theme_hook_suggestions in preprocess node template based on the fact that a field (field_logo) is empty or not.
The template change is not working.
Can anyone help?
This is the code that I have so far:
function community_alpha_preprocess_node(&$vars) {
$node = $vars['node'];
if(($node->type == 'advertorial') && !$teaser && $node_top){
$advertorial_type = $node->field_logo['und'][0]['tid'];
if(!empty($advertorial_type)){
$vars['theme_hook_suggestions'] = 'node__advertorial';
}else{
$vars['theme_hook_suggestions'] = 'node__advertorial__alt';
}
}
}
Thanks.