Detail Page Random Upload

2 posts by 2 authors in: Forums > CMS Builder
Last Post: June 29, 2017   (RSS)

By Damon - June 29, 2017

Hi,

On the detail page, to show uploaded images in a random order, use the shuffle() function. 

Here is an example of the code:

<?php shuffle($newsRecord['image']); ?>
<?php foreach ($newsRecord['image'] as $index => $upload): ?>
<img src="<?php echo htmlencode($upload['thumbUrlPath']) ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" />
<?php endforeach ?>

Hope this helps!

Cheers,
Damon Edis - interactivetools.com

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