Image Slider

4 posts by 2 authors in: Forums > CMS Builder
Last Post: February 10, 2012   (RSS)

Re: [kdub718] Image Slider

By robin - February 10, 2012

Hey,

Looks like you have a variable name mixup. You've created a your record variable as $mainRecord, but your foreach loop is looking for $record.

If you switch your foreach to something like this it should help:
<?php foreach ($mainRecord['upload'] as $upload): ?>

Hope that helps,
Robin
Robin
Programmer
interactivetools.com

Re: [robin] Image Slider

By kdub718 - February 10, 2012 - edited: February 10, 2012

hrm, I tried it but still not working...? Any other ideas? Does it matter that its pulling from a single record?

But I did notice the error has changed to this

Notice: Undefined index: upload in.....
Warning: Invalid argument supplied for foreach() in....

Re: [robin] Image Slider

Hey,

Looks like you have a variable name mixup. You've created a your record variable as $mainRecord, but your foreach loop is looking for $record.

If you switch your foreach to something like this it should help:
<?php foreach ($mainRecord['upload'] as $upload): ?>

Hope that helps,
Robin


I got it working... I thought I would post incase anyone in the future has this same problem I did... anyway..

I used this:
<?php foreach ($mainRecord['image'] as $upload): ?>

Thanks for your help,