Image List

7 posts by 2 authors in: Forums > CMS Builder
Last Post: January 31, 2011   (RSS)

Re: [kcmedia] Image List

By Jason - January 31, 2011

Hi,

The default image output code that the code generator produces just displays all of images in a record but it doesn't add any extra formatting that the gallery script may require.

Try something like this:

<?php if($record['image']): ?>
<?php $firstImage = $record['image'][0]; ?>
<img src="<?php echo $firstImage['urlPath'];?>" id="pic" alt="" />

<ul id="thumbs">
<?php foreach($record['image'] as $image): ?>
<li><a href="<?php echo $image['urlPath'];?>"><img src="<?php echo $image['thumbUrlPath'];?>" alt="" /></a></li>
<?php endforeach ?>
</ul>
<?php endif ?>

---------------------------------------------------
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: [Jason] Image List

By KCMedia - January 31, 2011

Hi Jason

i tried that but didnt work.

here is the link to the site

www.hotlocks.net.au/index.php

it is under the gallery link and also find attached the page for the current code.

also what do you think of the site so far?
Thanks



Craig

KC Media Solutions

www.kcmedia.biz
Attachments:

index_033.php 15K

Re: [kcmedia] Image List

By Jason - January 31, 2011

Hi,

The code I provided is for inside the loop outputting your gallery records. Try this:

<h2>gallery</h2>

<?php foreach($galleryRecords as $record): ?>
<?php if($record['image']): ?>
<?php $firstImage = $record['image'][0]; ?>
<img src="<?php echo $firstImage['urlPath'];?>" id="pic" alt="" />

<ul id="thumbs">
<?php foreach($record['image'] as $image): ?>
<li><a href="<?php echo $image['urlPath'];?>"><img src="<?php echo $image['thumbUrlPath'];?>" alt="" /></a></li>
<?php endforeach ?>
</ul>
<?php endif ?>

<?php endforeach ?>

</div>


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: [Jason] Image List

By KCMedia - January 31, 2011

Hi Jason

no didnt really work have a look at the page now.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] Image List

By Jason - January 31, 2011

Hi Craig,

The images are outputting properly. I think the issue you're having is that you set the gallery section up as a multi-record section and then uploaded one image for each record. What you're probably looking for is to have 1 record with all the images uploaded to that one record. That way you'll get one main image and a list of thumbnails.

Give that a try.
---------------------------------------------------
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: [Jason] Image List

By KCMedia - January 31, 2011

Hi Jason

ok thanks for that i have changed that now and all works great.

You guys are the best.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz