3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 25, 2017   (RSS)

By Deborah - July 25, 2017

Hi, Larry.

Here's what I usually do, assuming the 'featured' listings are chosen via a checkbox in the 'festivals' editor. I would create a separate load records name for display of the left-column listings, while leaving the existing code in place for the regular listings.

// load records for featured festivals
list($festivalsRecordsFEATURED, $festivalsMetaData) = getRecords(array(
'tableName' => 'festivals',
'where' => ' featured LIKE "1" ', // if checkbox for featured is checked
'limit' => '5', // change to desired number or remove to show all featured
'orderBy' => 'RAND()', // randomizes display order
'loadUploads' => true,
'allowSearch' => false,
));

<?php foreach ($festivalsRecordsFEATURED as $record): ?>
<?php if ($record['top_photo']) : ?>
<?php foreach ($record['top_photo'] as $index => $upload): ?>
<p><a href="<?php echo $record['_link'] ?>">
<img src="<?php echo htmlencode($upload['thumbUrlPath']) ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" />
<br />
<?php echo htmlencode($record['title']) ?>
</p>
<?php endforeach ?>
<?php endif; ?>
<?php endforeach ?>

See if that accomplishes what you need to do.

~ Deborah

By dlsweb - July 25, 2017

you are terrific, thank you