Hello,
Can someone help me add a url link in the image description? I am using an "overlay" gallery (prettyphoto) and want viewers to be able to visit a site instead of going to the next image when clicked on images that are websites.
CSS Code I am using:
<li><a href="images/work/work-full1.jpg" rel="prettyPhoto[1]" title="Trade Show Panels - 2011"><img src="images/work/work-thumb1.jpg"></a></li>
<li><a href="images/work/work-full2.jpg" rel="prettyPhoto[1]" title="Local Resource Website - Lake Wylie, SC"><img src="images/work/work-thumb2.jpg"></a></li>
and so on...
View gallery in action here:
click on the work tab.
Thanks for any help on this.
Hey there,
So to be clear: Do you want to be able to have the link in the caption area to be clickable and then have it take the user to the link, or do you want the user to click on an image, and then click the right arrow and instead of jumping to the next image go to the site first?
-Devon
Devon,
Thank you for your message. Either the link in the caption area to the webpage or clicking on the photo would works. really whatever is easiest. I know now if you click on the image it takes you to the next (just like the arrow) but opening up the link from clicking on the photo would work as well:)
Thanks again!
No problem! Okay, let's try this for the link in the caption area:
In order to link the text in the caption area, you need to convert the double quotes and greater than or less than signs in your link to their HTML entities (this is because the href link you are currently using would get confused by the regular "<"s being used, so in order to keep them separated for the code to be read correctly, we convert them to their entitity.).
So for instance your first link would look like:
<li>
<a href="images/work/work-full1.jpg" rel="prettyPhoto[1]" title="<a href="yourLink.html">Trade Show Panels - 2011</a>"><img src="images/work/work-thumb1.jpg" /></a>
</li>
Where > = > and < = <
Where " = "
Let me know if that helps!
Hi Nancy,
I spoke too soon. I still can't get it to open in a new window. Tried variations of the code. The link works but no new window:( This is what I have now.
<li><a href="images/work/work-full3.jpg" rel="prettyPhoto[1]" title="<a href="http://doubleulabs.com/P21/index.html">Web Link"target="_blank"><img src="images/work/work-thumb3.jpg" /></a>
</li>
Sorry to keep bothering you on such a minor thing I should be able to fix myself.
Hi there,
Looks like what you've got is close. Try this:
<li><a href="images/work/work-full3.jpg" rel="prettyPhoto[1]" title="<a href="http://doubleulabs.com/P21/index.html" target="_blank">Web Link</a>"><img src="images/work/work-thumb3.jpg" /></a>
</li>
That should open the link in a new window. Let me know if it works for you! : )
I apologize, I converted the quotes and greater than sign in your pretty photo link also. This should work:
<li><a href="images/work/work-full3.jpg" rel="prettyPhoto[1]" title="<a href="http://doubleulabs.com/P21/index.html" target="_blank" >Web Link</a>"><img src="images/work/work-thumb3.jpg" /></a>
</li>
If that code doesn't work for you, is there anyway you could post a download link to a .zip file with your source files? It might be easier for me to troubleshoot this for you if I have the sources to test. : )
Thanks!
<li><a href="images/work/work-full3.jpg" rel="prettyPhoto[1]" title="<a href="http://doubleulabs.com/P21/index.html">Web Link"target="_blank"><img src="images/work/work-thumb3.jpg" /></a>
</li>
I also wanted to add^ The reason why this line didn't work is because the target="_blank" wasn't converted to it's entity and it was also placed inside the area where the text is. In order for it to work, target="_blank" should always go inside the beginning of the href (<a href="..." target=_"blank">) Just thought I would point that out for your future reference. : )
You are going to kill me. No go yet. The "Web Link"text is not showing up with the new code. Anywho here is a link to the parent files:) Thank you again,
http://doubleulabs.com/adobeforums.html
the code before this round has been put back in.
Hi there,
No worries. It's a confusing line of code to wrap someone's brain around. : )
I have gotten it to work for me using this code:
<li><a href="images/work/work-full5.jpg" rel="prettyPhoto[1]" title="<a href="http://doubleulabs.com/rodden/index.html" target="_blank">Click Me</a>"><img src="images/work/work-thumb5.jpg"></a></li>
Access my source files here: www.jawdroppingdesign.com/HTML_new.zip
What browser are you viewing this in? I tested in Firefox, Chrome, and Safari on Mac OSX Lion...
Hi kinetic,
I am wondering how you finally fixed the problem. I am running into the very same issue you were troubleshooting here. I have tried all the suggestions from dhosford but still haven't solved it. I see that you worked it out and have tried to view source & figure out what I'm doing wrong but... can't seem to get it.
Here is what I have right now:
<a href="img/success/lg_dani_in_paper.jpg" rel="lightbox [gallery1]" title="<a href="http://www.charlotteobserver.com/2012/07/06/3359375/new-graduate-is-be autiful-and.html">Web Link"target="_blank"><img src="img/success/sm_dani_in_paper.jpg" alt="Dani recently graduated from High School and was even asked to lead her class in the pledge of allegiance."></a>
Did you have to modify the javascript?
Thanks!
Amanda
Hi Amanda,
Do you have this link live somewhere that I can see it in action? Also, the space between "be" and "autiful" in your link may be causing some problems. Also, the end quote and end chevron need to be converted to their entities, and you also need to close your link with </a> converted to entities after 'Web Link' before your target tag.
I hope this helps.
-Devon
http://amandabaucom-portfolio.com/ddr/ddr_new_phpmod_archived/index.ph p?section=success
I am building at the site above. I have messed with it a bit since I asked the question trying to figure it out... no success yet. I also am using lightbox2.0 instead of prettyPhoto, but in looking at prettyPhoto I may be interested in changing over to it. I cloned the site to install prettyPhoto and test it out, but am running into some issues there too. Might be time to call it a day and try again tomorrow.
Thanks for the quick response!
Amanda
Amanda,
As a personal preference I like to use shadowbox: http://www.shadowbox-js.com/ --Just a suggestion. : )
I think you're right in taking a break, sometimes that does worlds of difference when trying to solve a problem. I will keep working on this to identify your specific solution and will post it here if I find anything. : )
Thank you!
-Devon
Hi Amanda,
I'm still working on this for you and got the link to open just fine in Shadowbox. Have you tried modifying the js like kineticcreative123 suggested? I have a feeling there might be something wrong there. I'm still looking for a solution for lightbox specifically though.
This is the code I used to make it work:
"<a href="http://www.charlotteobserver.com/2012/07/06/3359375/new-graduate-is-be autiful-and.html" target="_blank">Web Link"
(Also this has the page open in a new browser)
Devon,
I acutally just checked out Shadowbox, I had not used it before. It looks clean and works like a charm. Easier to install and seems to have the same features as prettyPhoto or lightbox. Thanks for that suggestion. I am going to use it rather than Lightbox.
Thanks!!
Kinetic,
I never did figure out why it isn't working and I'm not a javascript genius even though I would love to be. The way it works on your site is nice though, I don't mind it opening in the same browser window because users instictively use the back button to return to your site. My situation was a bit different becuase it wouldn't open the link at all unless I right clicked and chose "open in new window". I figured most people would just think the link in broken and don't want that.
I noticed you are out of Rock Hill, I'm in Charlotte
. Locals.
Thanks!
Amanda
Amanda,
I'm so glad that I was able to help (in a small way) Shadowbox is great. It makes the images look 10x better in my opinion too because of the lack of a border. Also it will honor the customization of your link in the caption if you give it an id/class. Let me know if you need any more help!
-Devon
The only issue I have with it is that in lightbox my captions could be a couple paragraph's long and they sat below the images, in shadowbox they are above the image and can only be a few words long. I am fiddling with it right now to see if I can expand or move the caption to the bottom.
http://amandabaucom-portfolio.com/ddr/ddr_new_phpmod/index.php?section =success
Hi.
I Have used the corect answer of this topic here and it worked perfectly. i have allso added an image as a link. Thank you for help.
Is it possible to add more than one link?
Here is my code:
<li> <a href="images/contacts/2c.jpg" rel="lightbox" title="<a href="http://www.jaga.lt/ " target="blank"> <img src="images/contacts/1p.jpg" </a>"></a> </li>
North America
Europe, Middle East and Africa
Asia Pacific