Caption link with target=_blank

Forums Forums Slimbox2 plugin Caption link with target=_blank

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1783
    come_paglia
    Member

    Hey at all,

    it’s a couple of months now that I use WP-Slimbox2 as plugin in my WordPress installation and I’m very satiesfied with the adaptability of the optic and the range of functions.  <img decoding=” title=”Smiley” />
    My only problem ist, that I’d like the link behind the caption to be opened in a new window or tab, but not in the same window. Unfortunately my knowledges concerning javascript are a little bit limited, so I don’t find the right position (file, line/position) where I have to insert the argument.

    Would anybody be so kind to help me?

    Thanks alot in advance,
    Hella

    #9363
    malcalevak
    Moderator

    That’s a good question, this might be something I should make default, though I seem to recall reading that that sort of target was technically invalid…

    Whatever the case is, for your purposes just replace each instance in the code of:
    <code><a href="’ + encodeURI(el.href) + ‘"></code>
    With:
    <code><a href="’ + encodeURI(el.href) + ‘" target="_blank"></code>

    That SHOULD do the trick, though I haven’t confirmed it.

    If you have any issues pop back in and let me know. Thanks for the idea!

    #9364
    come_paglia
    Member

    Hey,

    thanks for the idea, where I have to look for the right code snippet to extend.
    I added the argument in the file
    wp-slimbox2/javascript/slimbox2_autoload.js
    and it seems to work right now.

    Perhaps you could integrate a checkbox in the admin panel, so users can choose the behaviour of the link.

    Regards,
    Hella

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.