Image in combo viewer list

5 posts by 2 authors in: Forums > CMS Builder
Last Post: December 3, 2012   (RSS)

Re: [Toledoh] Image in combo viewer list

Hi Tim,

I think the problem is in your foreach statement your using the variable $record, which doesn't look like it's set to anything. I think you need to change it to $listRecord['images'].

<?php foreach ($productsRecords as $listRecord): ?>
<?php $isSelected = ($listRecord['num'] == $detailRecord['num']); ?>
<li<?php if ($isSelected) { print " class='active'"; } ?>><a href="<?php echo htmlencode($listRecord['_link']) ?>">
<div class="thumb">
<img src="<?php foreach ($listRecord['images'] as $index => $upload): ?><?php echo $upload['thumbUrlPath'] ?><?php break ?><?php endforeach ?>">
</div>
<div>
<?php echo htmlencode($listRecord['make']) ?> <?php echo htmlencode($listRecord['model']) ?><br />
Year: <?php echo htmlencode($listRecord['year']) ?><br />
Hours: <?php echo htmlencode($listRecord['hours']) ?><br />
Price: <?php echo htmlencode($listRecord['price']) ?>
</div>
</a></li>
<?php endforeach ?>


Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Image in combo viewer list

By Toledoh - December 3, 2012

I tried that also Greg - no images still.

I've attached the files, the page can bee seen http://blakemachinery.com.au/2012/products.php?type=7

Thoughts?
Cheers,

Tim (toledoh.com.au)
Attachments:

products_004.php 10K

_top.php 3K

Re: [Toledoh] Image in combo viewer list

I think I've got it this time. loadUploads set to false on the getRecords function for $productRecords, setting it to true should solve the problem:

// load list records from 'products'
list($productsRecords, $productsMetaData) = getRecords(array(
'tableName' => 'products',
'loadUploads' => true,
'allowSearch' => true,
));


If that doesn't fix it could you attach _globalViewers.php to a post as well?

Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Image in combo viewer list

By Toledoh - December 3, 2012

That fixed it it! I knew there would be something that simple. Thanks!
Cheers,

Tim (toledoh.com.au)