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>– 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
PHP Programmer - interactivetools.com
By ScottL - February 17, 2016 - edited: February 17, 2016
Yes, I can get an upload to display fine when using the raw code from code generator, but when I transfer it over to my current setup, I'm getting errors:
Notice: Undefined variable: record in /hermes/bosnaweb07a/b687/ipw.website/public_html/forsale.php on line 110 Warning: Invalid argument supplied for foreach() in /hermes/bosnaweb07a/b687/ipw.eaglescove/public_html/forsale.php on line 110
It's setup to display a list of categories, then records under each category.
I've attached my php file.
Thanks
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!
Damon Edis - interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/