Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2014-12-28 23:33:19

johncellsworth
Member
Registered: 2014-06-17
Posts: 22

HTML links in photo captions?

Is there a way to enter hot links in photo captions so when displayed in a CE4 gallery, they work? Thanks.

Offline

#2 2014-12-29 02:32:21

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: HTML links in photo captions?

yes. In the Library module you need to enter the html in the metadata field you're using for your caption.
Like so:
<a href='http://www.yoursite.com'>Link text</a>

for some reason, using the usual double quote processes out to the html escape character of &#34; upon export, which of course won't work.

There are probably some good reasons for not including html in the captions, like for SEO, but it does seem to work.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2014-12-29 03:15:25

johncellsworth
Member
Registered: 2014-06-17
Posts: 22

Re: HTML links in photo captions?

Hi Rod. I tried your suggestion but all the code still appears on my html page. Have a look:
http://johnellsworthphoto.com/image/gal … single.php

I tried a simpler link as well. Same results. Code shows. When in the slide-mode, the words "Sagittarius Fire" appear with no code. But when I click it, all icons disappear. My links are supposed to show full white #FFFFFF as in the footnote.
Thanks. If it can't be done, I'll figure something else out. I appreciate it.

Offline

#4 2014-12-29 04:31:11

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: HTML links in photo captions?

I don't know why it's not working. It works in my tests. What's weird is that for me, Lightroom is changing any double quotes into the html escape characters. I see this happening in the caption when I surround regular works with quotes. Your double quotes are showing up fine in your caption though.

In Site Info, under Page Setup, take a look at the Character set. I'm using utf-8 and the hyperlinks in the captions are working.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#5 2014-12-29 08:33:16

johncellsworth
Member
Registered: 2014-06-17
Posts: 22

Re: HTML links in photo captions?

Thanks for checking, Rod. I do have the same character set (utf-8). I appreciate your time. You provide a great service. I will let it ride for awhile. Will work on other things.

Offline

#6 2014-12-29 15:41:47

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: HTML links in photo captions?

It's not weird, it's a feature. See the CE4 Gallery 6.1.3 update:

"Sanitization of ampersands, quotation marks and line-breaks in image titles, captions, and in the grid's metadata display, and in the Album Title and Description."

Sanitizing metadata prevents titles and captions containing quotation marks from breaking img alt and title attributes, and also keeps the Galleria slideshow running in Pages and Stage.

Image metadata should not be used to store HTML, as this is not the intent for metadata in general or in Lightroom's design.


Matt

The Turning Gate, http://theturninggate.net

Offline

#7 2014-12-30 09:09:22

johncellsworth
Member
Registered: 2014-06-17
Posts: 22

Re: HTML links in photo captions?

I understand, Mat. I was confused—In my former TTG HTML galleries, I was able to insert links in the caption field, say for paypal ordering info or a link to a corresponding blog entry: http://johnellsworthphoto.com/galleries … -cafe.html
Can you suggest any other method of entering a link on an image page without corrupting the metadata attributes?
If not, no problem. Thanks.

Offline

#8 2014-12-30 15:45:25

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: HTML links in photo captions?

Nope.

Writing links -- or any type of HTML -- via metadata has never been a supported feature in any of our galleries. It sometimes worked simply because we did absolutely nothing to filter metadata content in the past. We are now sanitizing some entities for more valid HTML and to prevent code breakages. For example, you may now safely use quotation marks in caption text, which previously was disallowed.


Matt

The Turning Gate, http://theturninggate.net

Offline

#9 2014-12-30 15:51:20

johncellsworth
Member
Registered: 2014-06-17
Posts: 22

Re: HTML links in photo captions?

OK, thanks. Nothing to contest here. I have some other avenues to employ regarding my desire to link associated information on my website (as I rebuild it). Likely from my blog to the photo, rather than vice versa. I appreciate your responsiveness.

Offline

#10 2014-12-31 00:05:04

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: HTML links in photo captions?

Matthew wrote:

For example, you may now safely use quotation marks in caption text, which previously was disallowed.

Maybe this is why I thought it was weird. The only type of quotation marks that will appear for me are single quotes. If I use double quotes I get the html escape code: &#34;. This shows up in the Web Module as well as in online galleries.

see the captions on the two images in this test gallery: http://ce4.barbeephoto.com/galleries/caption-test/

I'm using Windows, if that might make a difference.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#11 2015-01-01 21:37:35

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: HTML links in photo captions?

That's bloody odd, Rod. Works okay for me. I shouldn't think Windows should make difference, but then it's Windows ...

Anyone else reading this that might corroborate Rod's experience?


Matt

The Turning Gate, http://theturninggate.net

Offline

#12 2015-01-01 23:31:14

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: HTML links in photo captions?

tried it on my Windows laptop too. Same results


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#13 2015-01-02 00:46:31

trummonte
Member
From: Buena Vista, Colorado
Registered: 2012-11-11
Posts: 178
Website

Re: HTML links in photo captions?

Hi Matt. I just tested on my Windows notebook (Windows 8.1) with the latest version of Chrome, Firefox, and IE. It does what Rod is saying.

Offline

#14 2015-01-02 04:32:29

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: HTML links in photo captions?

This is Chrome on a Mac:

34.png

I get the same result with Safari. The code is:

<strong>&amp;#34;Rainbow Bridge&amp;#34;</strong>

Looks like the ampersand shouldn't be escaped.


Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#15 2015-01-02 04:34:42

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: HTML links in photo captions?

Daniel,

this is coming out of Lightroom on a Windows machine. So I see the problem in Lightroom as well as on the web.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#16 2015-01-02 04:47:34

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: HTML links in photo captions?

Rod, looks like Matt has a magic computer so it works for him ;-)

Happy New Year!


Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#17 2015-01-02 05:14:31

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: HTML links in photo captions?

I think he's on a mac


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#18 2015-01-02 10:11:26

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: HTML links in photo captions?

And Macs, as we all know, really are magical ...


Matt

The Turning Gate, http://theturninggate.net

Offline

#19 2015-01-02 10:16:48

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: HTML links in photo captions?

Miracle Macs, perhaps?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#20 2015-01-02 10:53:25

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: HTML links in photo captions?

Okay, I've setup a Windows install of LR 5.7.1 and I'm seeing the problem too. Friggin' weird, that is.

Although, the ampersand replacement (& v &amp;) seems to be okay.


Matt

The Turning Gate, http://theturninggate.net

Offline

#21 2015-01-02 11:13:11

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: HTML links in photo captions?

I found the problem. There's an issue in the sequence of instructions for the sanitization, which for some reason is not an issue running on Mac, but which is an issue running on Windows. Go figure ...

Next update will resolve, but if you'd like to fix this yourself in the meantime, do a

Find:

    metadata = string.gsub(metadata, "\"", "&#34;")
    metadata = string.gsub(metadata, "\n", "<br />")

    metadata = string.gsub(metadata, "&", "&amp;")
    metadata = string.gsub(metadata, "&amp;", "&amp;")
    metadata = string.gsub(metadata, "&amp;amp;", "&amp;")

and Replace:

    metadata = string.gsub(metadata, "&", "&amp;")
    metadata = string.gsub(metadata, "&amp;", "&amp;")
    metadata = string.gsub(metadata, "&amp;amp;", "&amp;")

    metadata = string.gsub(metadata, "\"", "&#34;")
    metadata = string.gsub(metadata, "\n", "<br />")

The only difference here is that we're not processing ampersands first, and other things afterward, rather than processing ampersands last.


Matt

The Turning Gate, http://theturninggate.net

Offline

#22 2015-01-02 12:22:30

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: HTML links in photo captions?

Interesting. Was this only an issue with metadata that included new lines? If so, it could be because Windows uses two characters for newlines, \r\n, so the newline substitution might not be working as expected and cause adverse results for subsequent replacements.

Offline

#23 2015-01-02 13:26:39

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: HTML links in photo captions?

I was testing with just one line of metadata.

Just curious Matt, in what file would that code above be found?


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#24 2015-01-02 14:47:20

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: HTML links in photo captions?

/lib/lua/setup.lua
/lib/xml/autoindex.xml


Matt

The Turning Gate, http://theturninggate.net

Offline

#25 2015-01-02 14:49:34

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: HTML links in photo captions?

Ben wrote:

Interesting. Was this only an issue with metadata that included new lines? If so, it could be because Windows uses two characters for newlines, \r\n, so the newline substitution might not be working as expected and cause adverse results for subsequent replacements.

I didn't know that about Windows. So I'll try updating with this:

    metadata = string.gsub(metadata, "&", "&amp;")
    metadata = string.gsub(metadata, "&amp;", "&amp;")
    metadata = string.gsub(metadata, "&amp;amp;", "&amp;")

    metadata = string.gsub(metadata, "\r\n", "<br />")
    metadata = string.gsub(metadata, "\n", "<br />")

    metadata = string.gsub(metadata, "\"", "&#34;")

Matt

The Turning Gate, http://theturninggate.net

Offline

Board footer

Powered by FluxBB