Grouping

16 posts by 2 authors in: Forums > CMS Builder
Last Post: September 19, 2011   (RSS)

By KCMedia - June 6, 2011

Hi Jason

just filled out
Thanks



Craig

KC Media Solutions

www.kcmedia.biz
Hi Jason

I have done this function on other sites since you help me with this but i am unable to get this to work on a newsite i am working on.

I have attached the code i have been working with just wont show the images but it shows all the titles and contact no worries.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz
Attachments:

speed-shop.php 9K

Re: [kcmedia] Grouping

By Jason - September 16, 2011

Hi Craig,

I took a look at your code and couldn't see anything immediately wrong.

One thing I did notice was that you start your div for your images outside of your foreach loop, but end it inside an if statement inside your foreach loop. This will mean that your div tags will not be balance if you have no images, or more than 1 image. Try this instead:

<div class="img">
<?php foreach ($record['images'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<a href="speed-shopProducts.php?manufacturers=<?php echo $record['title'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" /></a>
<?php endif ?>
<?php endforeach ?>
</div>


I would need to be able to take a look at the code running in order to better understand why the images aren't showing up. If you want to email me the details, we can take a look.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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

Re: [kcmedia] Grouping

By Jason - September 19, 2011

Hi Craig,

I took a look at your CMS and found that in your manufacturers section you have an upload field called "image". However, in your code you use the index $record['images'] in your foreach loop.

Try changing $record['images'] to $record['image']. That should take care of the issue for you.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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

thanks for that jsut couldnt see the issue all good now.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz