0

I'm outputting fields in a template for my content type like so:

print render($content['group_details']['field_city']);

However, I would like to replace the default label that is attached to the 'city' field. I cannot alter the label in Drupal's content type so I'd really need to do so directly in the template. How can I instruct Drupal to hide the current label and replace it with a custom label in the content type template?

1

OK it's a bit round the houses, but you should be able to do:

$content['group_details']['field_city']['#label_display'] = 'hidden';
print '<h2>Title</h2>'; // change to any HTML
print render($content['group_details']['field_city']);

Not the answer you're looking for? Browse other questions tagged or ask your own question.