mahmoodee
Member
Hello
I have a group called: estate and data element called: city.
in custom details template
I want to hide table row if element value empty
when I delete the city value and become empty it still show the row
why this code not work well?
I have a group called: estate and data element called: city.
in custom details template
Code:
$estate=$this->groups['estate'];
$estate2=$estate->elements;
$rcity=$estate2['city']->element;
$rcitylabel=$estate2['city']->label;
I want to hide table row if element value empty
Code:
<?php if(!empty($rcity)){ ?>
<tr>
<td >
<?php echo $rcitylabel; ?>
</td>
<td>
<?php echo $rcity; ?>
</td>
</tr>
<?php } ?>
why this code not work well?