Board index PBase Questions and Answers Links And Images in Captions

Questions and Answers

Links And Images in Captions

Ask if you need help using PBase.
akmc_in_au
 
Posts: 954

Links And Images in Captions

Post Tue Apr 03, 2012 3:00 am


Please excuse the absence of a visible question here, but something that a couple of users have asked me privately once or twice concerns putting links in image Caption or gallery Description fields. It's difficult to describe in a PMail which doesn't, as far as I can see, have a Code block, so I'm putting up a quick crib post here that I can point to. (And which some other new users may benefit from.)

To Create A Text Link To Another Page
Use the <a (anchor) tag, with href= pointing to the page that you want the link to lead to. Put a closing angle bracket (>) after the link. You can then type the text that you want to appear in your caption, which will be a clickable hyperlink. Close the link with a /a combination inside a pair of angle brackets. For example:

Code: Select all
<a href="http://www.LinkToPage.html">The Text That You Want To Appear</a>


To Add A Thumbnail Image Which Links To Another Of Your Images
Again you use the Anchor tag (<a), as well as the href=argument pointing to the page of the image that you want to link to. You could, if you wanted to, add /Original or /Large (for instance) after this link to determine which size of image the viewer will land on but I don't recommend doing that; it can screw up the viewer's own selection for their preferred image size when they move off your image. Before closing the angle bracket you can add a Title argument if you want, but for most viewers this won't be visible. After that you open another angle bracket and put the argument img src followed by an = sign. This is where you add the link to the thumbnail of the image that you're linking to. That thumbnail will appear on your page instead of text. In this case you do specify the size of the image, as well as the file extension since you're creating the link from the image alone, not the whole page that the image appears on. (1234 represents the number of your actual image, which you can see in your browser's address bar when you're on it. The address would look something like http://www.pbase.com/akmc_in_au/image/142279257, so 1234 would be replaced in this case with 142279257.) Finally you can, if you want, add an alt= argument which is what will appear if the image can't be shown. Close this block with another angle bracket, then close the entire link with /a inside a pair of angle brackets. Example:

Code: Select all
<a href="http://www.pbase.com/YourPBaseUserName/image/1234" Title="My Other Photo"><img src="http://www.pbase.com/YourPBaseUserName/image/1234/small.jpg" alt="My Other Photo"></a>

dougj
 
Posts: 2276

Re: Links And Images in Captions

Post Tue Apr 03, 2012 6:49 am


Nice to post the helpful tips Alan.

pfmerlin
 
Posts: 5

Re: Links And Images in Captions

Post Fri Apr 20, 2012 2:00 pm


Hi akmc_in_au,
I use to add links in captions, but it looks like since I set my default editor to the new one, all my links disappeared.
It remove <a href="http://www.LinkToPage.html">The Text That You Want To Appear</a> and keep only: The Text That You Want To Appear.
I tried to come back to the old editor but, the problem is still there.
Do you have any idea how to fix this?

pfmerlin
 
Posts: 5

Re: Links And Images in Captions

Post Fri Apr 20, 2012 2:07 pm


Hum, finally, i tried agin with the old editor and everything is fine. Perhaps, there was a cache issue (I closed my browser before trying again).
Sorry for the inconvenience.

andrys
 
Posts: 2701

Re: Links And Images in Captions

Post Tue Jun 05, 2012 2:35 am


Thanks, Alan.

I wanted to add that you can also link to another image or page in the TITLE just under the image *if* you use Single Quote marks instead of double quote marks.

It even honors the optional parameter ( target=_blank) after ending the quoted URL, to open a new window for the target page so the reader does not lose the current page.

Form example:
<a href='http://thisplace.com' target=_blank>info page</a>


Board index PBase Questions and Answers Links And Images in Captions

Who is online

Users browsing this forum: No registered users and 4 guests