Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Instant Website: Realty/Listings/Auto:
Show First Image Only & total images online no.

 

 


jarvis
User

Apr 8, 2009, 1:30 AM

Post #1 of 4 (2509 views)
Shortcut
Show First Image Only & total images online no. Can't Post

Hi all,

I'm being thick I think! So my apologies!! We've set the CMS to allow up to 10 property images, however, on my listingsList.php page I only want to show the first uploaded image as well as the total no of images online for that property. How do you do it? I've tried everything I can think of but to no avail!

Sorry am a bit of a noob! Thanks

Jarvis


ross
Staff / Moderator


Apr 8, 2009, 10:13 AM

Post #2 of 4 (2488 views)
Shortcut
Re: [jarvis] Show First Image Only & total images online no. [In reply to] Can't Post

Hi jarvis

Let's start with having just one image appear. On your template right now, you'll have a foreach loop that displays all your images. What you need to do just before the end foreach line is add in this:

<?php break; ?>

That will stop the loop from repeating. Give that a shot and let me know how it goes.

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com

Hire me!  Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/



jarvis
User

Apr 9, 2009, 1:05 AM

Post #3 of 4 (2434 views)
Shortcut
Re: [ross] Show First Image Only & total images online no. [In reply to] Can't Post

Hi Ross,

That's great, I'd actually worked that one out in the end - sorry, should've updated the ticket! How would you then go about listing how many images are shown per property?

Thanks


ross
Staff / Moderator


Apr 9, 2009, 9:17 AM

Post #4 of 4 (2423 views)
Shortcut
Re: [jarvis] Show First Image Only & total images online no. [In reply to] Can't Post

Hi jarvis

Right before the break; line, add this code:

<b><?php echo count($record['image']); ?></b>

That will display how many images the record has. Give it a shot and let me know what you think :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com

Hire me!  Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/