How can I hide a DIV if ther's no value in that Content in a node--customtpl.tpl.php file? I have used a code something like this, but if hides everything weather it has data or not. Can anyone help me with this code?
I want to hide this "special-offer" div if there's no value in that field in drupal (this_is_a_drupal_field).
<?php
if ($content['this_is_a_drupal_field'])
{
print "<div class='special-offer'>";
print render($content['this_is_a_drupal_field']);
print "</div>";
}
?>
<?php if(empty($content['this_is_a_drupal_field'])){ ?>