Skip to main content
corrected answer
Source Link
Ankit Agrawal
  • 4k
  • 1
  • 22
  • 38

One way of doing that is using a combination of isset and empty to check the field as following:

<?php print (isset($fields['field_brand_image']) && !empty($fields['field_brand_image'])) ? 
  $fields['field_brand_image']->content : ''; ?>

One way of doing that is using a combination of isset and empty as following:

<?php print (isset($fields['field_brand_image']) && !empty($fields['field_brand_image'])) ? 
  $fields['field_brand_image']->content : ''; ?>

One way of doing that is using a empty to check the field as following:

<?php print (!empty($fields['field_brand_image'])) ? 
  $fields['field_brand_image']->content : ''; ?>
Source Link
Ankit Agrawal
  • 4k
  • 1
  • 22
  • 38

One way of doing that is using a combination of isset and empty as following:

<?php print (isset($fields['field_brand_image']) && !empty($fields['field_brand_image'])) ? 
  $fields['field_brand_image']->content : ''; ?>