hide table row if empty in custom details template problem

mahmoodee

Member
Hello
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 } ?>
when I delete the city value and become empty it still show the row
why this code not work well?
 
We can't do custom code debugging in Community support.

But typically, if a variable isn't acting as you expected, dump the value and see what it is.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top