Add thumbnail image to listing

5 posts by 3 authors in: Forums > CMS Builder
Last Post: February 17, 2016   (RSS)

By ScottL - February 16, 2016

How can I add a thumbnail to an Product Listing?  

This displays as:

• Product Category

(want thumb here) Product Item Here - more info

Here's the code I'm using on the List page:

<div align="left">
<?php foreach ($interior_categoriesRecords as $categoryRecord): ?>
<?php echo $categoryRecord['_listItemStart'] ?>

<?php if ($categoryRecord['_isSelected']): ?>

<?php endif ?>
<span class="projectcategory"><?php echo $categoryRecord['name'] ?></span>
<?php if ($categoryRecord['_isSelected']): ?>

<?php endif ?>
<?php if (array_key_exists($categoryRecord['num'], $projectRecordsByCategory)):?>
<ul>
<?php foreach ($projectRecordsByCategory[$categoryRecord['num']] as $project): ?>
</ul>
<p class = "projectarticle"><?php echo $project['title'];?><em> </em><a href = "<?php echo $project['_link'];?>"><em>&ndash; more info</em></a> </p>
<?php endforeach ?>

</span></p>

<?php endif ?>


<?php echo $categoryRecord['_listItemEnd'] ?>
<?php endforeach ?>
</span> </div>

Thanks

Hi ScottL,

You can find the documentation that explains how to display a records uploads here:

http://www.interactivetools.com/docs/cmsbuilder/uploads.html

Let me know if you have any questions!

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Damon - February 17, 2016

Hi,

On line 110, change this code:

<?php foreach ($record['galleryimages'] as $upload): ?>

to this

<?php foreach ($project['galleryimages'] as $upload): ?>

Let me know if this resolves the error message.

Thanks!

Cheers,
Damon Edis - interactivetools.com

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

By ScottL - February 17, 2016

Perfect.  Thanks!