Wrong image displaying/same image on every page

5 posts by 3 authors in: Forums > CMS Builder
Last Post: April 8, 2009   (RSS)

By Kittybiccy - April 7, 2009

I've added a top banner image field so that on each record (detail pages) different banner images show.

I added the generated code into the cell where the image is to be displayed:
<?php foreach ($church_endRecord['top_banner'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>

<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

<?php endif ?>
<?php endforeach ?>

But when you navigate through the pages, the image from the first record is displayed on every page. I have checked and there are different images in CMSB for each so I'm not being that stupid!

This is the page I'm testing:
http://www.arcschoolsuk.com/CMSB/church_end.php?1 and if you click through to facilities or resources no change in top image!

Any suggestions?

Re: [Kittybiccy] Wrong image displaying/same image on every page

By Kenny - April 7, 2009

Try adding this to your top of page code

'orderBy' => 'RAND()',

That should pull a random image each time.

Kenny

Re: [sagentic] Wrong image displaying/same image on every page

By Kittybiccy - April 7, 2009

Each page has a specific image generated from the CMSB record so not random, would that still work?

I basically need it to pull in the top banner image as it pulls in the copy and the side image.

Re: [ross] Wrong image displaying/same image on every page

By Kittybiccy - April 8, 2009

Hi Ross,

Attached is the page.

Why would they conflict, could you explain in real basic terms so I know what I'm doing wrong!

Hannah
Attachments:

church_end.php 7K