30 Posts
tiagovareta
5 years ago
Topic

Hi,

In an override template I have the following DIV:

<div class="starburstintro centrarprecopromointro">
<span><span><span><p>
<?php echo $cck->getValue('preco_promocao_ht'); ?>
</span></span></span></p>
</div>

To show this: http://prntscr.com/k81mag

But if the field (preco_promocao_ht) is empty, it continues to show the highlight star (without value).

How can I do to hide if the field is empty?

Get a VIP membership
4229 Posts
Kadministrator
5 years ago
1
Level 1

you can wrap the hole block in if statement

<?php if (!empty ($cck->getValue('preco_promocao_ht') ): ?>

your above code...
<?php endif; ?>

30 Posts
tiagovareta
5 years ago
0
Level 2

Hi Klas,

Many thanks for the reply! It served perfectly for what it pretended!

Get a VIP membership