Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Instant Website: Realty/Listings/Auto:
How to link from images in new window

 

 


willydoit
User

May 18, 2009, 5:47 AM

Post #1 of 4 (1463 views)
Shortcut
How to link from images in new window Can't Post

Hi all,

I have just about got my detail pages put together but have a small problem, I am using the code below to display the images down a left hand column on the page which is workling fine, the only problem is they dont habve hyperlinks to full size version which I would like to have open in a new window (would prefer them to display larger when hovered over but that can be sorted later but would be interested to know if anyone has already sussed out how to achieve it) I have copied the code below, if someone could advise on how this should be altered to provide the link in a new window, or even edit the code if it's easier I would appreciate it. Also the description tag does not display below the images, I would also like to include this if possible.

Thanks in advance.



<?php foreach ($serviced_accommodationRecord['uploads'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/><p></p>

<?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 ?>


(This post was edited by willydoit on May 18, 2009, 5:54 AM)


ross
Staff / Moderator


May 18, 2009, 9:05 AM

Post #2 of 4 (1450 views)
Shortcut
Re: [willydoit] How to link from images in new window [In reply to] Can't Post

Hi there.

Thanks for posting!

To get your thumbnails clicking through to full size images, you'll just need to add a link around the image tag. Right after <?php if ($upload['hasThumbnail']): ?> add this:

<a href="<?php echo $upload['urlPath']; ?>" target="_blank">

and then stick a closing link tag after the image.

You can do that for the other image tag as well if you like but if that code is being displayed, you probably don't have a bigger version of the image.

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/



willydoit
User

May 18, 2009, 9:43 AM

Post #3 of 4 (1446 views)
Shortcut
Re: [ross] How to link from images in new window [In reply to] Can't Post

Thanks Ross,

have now got them linking, its a bit clumsy at the moment but I can work on that, could you advise why I am not getting the descriptions for the images on the above code?

Thanks in advance


willydoit
User

May 18, 2009, 11:00 PM

Post #4 of 4 (1398 views)
Shortcut
Re: [willydoit] How to link from images in new window [In reply to] Can't Post

Worked out the description issue, thanks