No showing when no record there

2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 4, 2013   (RSS)

By Damon - January 4, 2013

Hi Jac,

Try this code for having the "Download" text not appear if there are no downloads:

<?php foreach ($events_tradeshowsRecord['download'] as $index => $upload): ?>
    <?php if($upload['urlPath']) : ?>
        <b>Download : </b><a href="<?php echo $upload['urlPath'] ?>"><?php echo htmlencode($upload['info1']) ?></a>
    <?php endif; ?>
<?php endforeach ?>

Let me know if this works for you.

Thanks!

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/