Sign in

Link in caption

  • This topic has 9 replies, 3 voices, and was last updated 3 days, 1 hour ago by .
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #6741
    clac1

    Hello,

    Is it possible to insert a link in the caption of a photo?

    Thanks in advance.

    #6743
    Bob

    Yeap, you can do that, just put the link in the caption, and modify the theme files ‎⁨(Documents ▸ ⁨Publii⁩ ▸ ⁨sites⁩ ▸ ⁨YOUR_SITE ▸ ⁨input⁩ ▸ ⁨themes⁩ ▸ ⁨YOUR_THEME) as follow:

    {{caption}} or {{credits}}

    to

    {{{caption}}} or {{{credits}}}

    To preserve your custom code and prevent it being overwritten the next time the theme is updated, please ensure that you have created override files; these are, essentially, copies of the existing theme files that are stored separately from the main theme fileshttps://getpublii.com/dev/theme-overrides/

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #6746
    clac1

    Hello,
    Thank you.

    I very sorry, but I don’t know in which file to make this replacement… I searched for that string but did not find an exact match.

    #6751
    candidexmedia

    Hello,

    Thank you.

    I very sorry, but I don’t know in which file to make this replacement… I searched for that string but did not find an exact match.



    @clac1
    You should be able to edit

    {{caption}}
    {{credits}}

    in the “index.hbs” and “post.hbs” files. If your theme has other templates, you’ll find that code there too. Not sure if the “amp-” files have to be edited as well, but I would just in case.

     

    #6798
    clac1

    Hello,

    I looked in the “index.hbs” and “post.hbs” files, there is no

    {{caption}} or {{credits}}

    I found only

    {{caption}}
    {{credits}}

    Is it the statements to modify ?

    Another question : to insert the link in caption, should I go in the html code or is there any way via the User Interface ?

    Thanks for your help!

    #6799
    candidexmedia

    Yes, that’s the statement to modify, as outlined in my reply.

     

    To insert the hyperlink, highlight the text of the caption in the Post Editor and hit CTRL+K.

    #6800
    clac1

    Thank you!

    I tried it and it is OK for single image, but it seems to be not possible to add a ling in captions for images in a gallery… ?

    #6804
    candidexmedia

    Thank you!

    I tried it and it is OK for single image, but it seems to be not possible to add a ling in captions for images in a gallery… ?

    I just tested it on my end: click on the gallery, and add the following HTML code in the respective “Image caption” field of the “Insert/Edit Gallery” dialog box:

    caption text

     

     

    Of course, replace ” https://website.com ” with the link and “caption text” with your caption.

    #6805
    candidexmedia

    I’m not sure why the comment engine added “nofollow”, but you can ignore that. Just add an < a > tag.

    #6806
    clac1

    Hello,

    Yes, it works!

    Thanks a lot.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Link in caption’ is closed to new replies.