When displaying output from CCK using the manage display fields, (I am not using a custom content template nor do I want to in my particular instance), if the link fields are empty, I still get the label for the link field displaying in my teaser or body. Any ideas on how to suppress it?

Comments

quicksketch’s picture

The only way to suppress the field label if there are no values is to use contemplate or theme your output in template.php or your node.tpl.php files.

chadchandler’s picture

Would you mind posting the correct snippet to hide a label if the field is empty in a custom node.tpl.php file?
If trying to hide the label Address if the particular node is empty...something like?....

 <?php if(!empty($node->field_address[0]['value'])){?>
<div class="field field-type-text field-field-address">
  <h3 class="field-label">Address</h3>
<div class="field-address"><?php print $item['view'] ?></div>
    <?php } ?>
  </div>
</div>
<?php } ?>

Almost?

mlncn’s picture

Possibly related request: http://drupal.org/node/198600 (do not make database entry for empty link)

quicksketch’s picture

Status: Active » Closed (fixed)

Take a look at the "theming" directory included with CCK installations. I'm going to close this because it's not directly a link-related request.

1kenthomas’s picture

Assigned: Unassigned » 1kenthomas

Self-assigning a dead issue. #4 is the correct response, roughly. Will post example code if I get a chance, in case others drop by here.