Drupal display content from field_view_field only if populated.

<?php if(field_view_field('node', $node, 'field_photo_image_credits')): ?> Title only shows with value: <?php print render(field_view_field('node', $node, 'field_photo_image_credits',array('label'=>'hidden'))); ?> <?php endif;?>
I know I could just show the label but if that were to change universally or there needs to be some of else if I can handle that through this.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.