CMS Product images

4 posts by 2 authors in: Forums > CMS Builder
Last Post: March 13, 2008   (RSS)

Re: [Roj] CMS Product images

By Dave - March 12, 2008

No problem. I'm assuming you've already got your list page and product page viewers setup right? And that you have images displaying on both pages?

If so, just use this code on the list page:

<?php foreach ($listRows as $record): ?>

...


<?php foreach (getUploads($options['tableName'], 'uploads', $record['num']) as $upload): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>"
width="<?php echo $upload['thumbWidth'] ?>"
height="<?php echo $upload['thumbHeight'] ?>"
alt="" /><br/>
<?php endforeach ?>

...

<?php endforeach ?>


and this code on the product page:

<?php if ($record): ?>

<?php foreach (getUploads($options['tableName'], 'uploads', $record['num']) as $upload): ?>
<img src="<?php echo $upload['urlPath'] ?>"
width="<?php echo $upload['width'] ?>"
height="<?php echo $upload['height'] ?>"
alt="" /><br/>
<?php endforeach ?>

<?php endif ?>


Hope that helps, let me know if I can provide more details or if you have any problems with that.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] CMS Product images

By Roj - March 13, 2008

Hi Dave,

Yes that did help. I had to change 'uploads' to 'images' in the first line of your code to get it to work but it is fine now.

Thanks
Roj

Re: [Roj] CMS Product images

By Dave - March 13, 2008

Sounds good, glad to hear it's working. :)

If you have any more questions just post and we'll help you out.
Dave Edis - Senior Developer
interactivetools.com