markup help

2 posts by 2 authors in: Forums > CMS Builder
Last Post: November 26, 2012   (RSS)

Re: [kcmedia] markup help

By gregThomas - November 26, 2012

Hi craig,

Something like this should do the job:

<?php foreach ($contact_usRecords as $listRecord): ?>

<li <?php echo ($listRecord['num'] == $detailRecord['num'])? 'class="active"' :''; ?> >
<a href="<?php echo htmlencode($listRecord['_link']) ?>"><?php echo htmlencode($listRecord['state_code']) ?></a>
</li>
<?php endforeach ?>
<?php if (!$contact_usRecords): ?>
<?php endif ?>


So when $listRecord['num'] is equal to $detailsRecord['num'] class="active" is shown, otherwise nothing is displayed.

Thanks!
Greg Thomas







PHP Programmer - interactivetools.com