How do I add formatted link to single_bottom

I have the new metadata feature now nicely formatted. Thanks - a big improvement in the looks of my single image pages. Now I am trying to add a link to a video file for each species that. The links are to videos on my site of which there are only a few but eventually will expand to several hundred clips. I can easily add a link to the videos in Lightroom metadata as long as the chosen metadata field is a long text field. The “Caption” filed works well and I can easily place the link in the figcaption location on the single image page. However, there are two additonal steps I can not find the right way to do. They are:

  1. Display the figcaption as formatted text so the link is active (I can construct that caption to contain all the needed html tags, and even make it a full html fragment) but and the input string is still ouput as plain text. I believe this may be a function of how the data is stored and retrieved from the Backlight MySQL file but without login info I cannot log in to that file with MyMyAdmin to find how this field is set.
  2. Although I can display figcaption with the single image easily enough, I would actually like to display it AFTER the formatted metadata info. I can easily place text where I want it by using function single_bottom() in my-phplugins but with my very limited php skills I cannot seem to get the figcaption into this, or into an html fragment to be placed here.

If anyone can suggest how to best approach what is essentially simply moving the figcaption to single_bottom and echo/print it as html I would appreciate any pointers.

I’m not sure if the figcaption element can live outside of the figure element or if doing so will break something. If it can be moved, you may be able to do it with jQuery via the phplugins script hook.

the password to access the database is “admin”

figcaption elements should NOT be moved outside of figure.

I don’t think you can add html to image metadata and expect it to show up as formatted text. It’s not been possible before.

1 Like

I think the best thing would be to inject the URL via image metadata. Put it in the caption, or into one of the metadata outlets. Then use jQuery or JavaScript to find it, move and manipulated it, and then output it to a new location on the page.

If HTML doesn’t work, then you might be able to pattern match a YouTube URL on the page using a regular expression, and work from there.

1 Like

For example, here’s a StackOverflow article on using regex on YouTube URLs.

1 Like

Or you could use phplugins to extract the metadata field and transform it into a link. Have a look at https://lab.danielleu.com/blog/customizing-single-page-view/ and the to_url function.

2 Likes