On my views-view-field template, I would like to print out 'field_images' if 'field_cover_image' is empty.
I tried this solution here but it throws me this error message.
Notice: Undefined variable: node in include() (line 45 of /sites/all/themes/mytheme/templates/views-view-fields--incubator.tpl.php).
EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7539 of /includes/common.inc).
Is there any other ways to check if a field is empty or not?
Thanks!
$field = field_get_items('node', $node, 'field_cover_image'); if($field){ print 'yes there is'; }else{ print 'no there isn't'; }