Announcement

Collapse
No announcement yet.

Open attachments in new window.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Open attachments in new window.

    I want attachments to open in new window/tab, not sure how to do that. Right now when you click attachment, it opens in the same window as the forum. I've looked everywhere and can't seem to find out where to change this. Please let me know if this is possible. Thanks!

  • #2
    There are 2 ways to do this while there's no official fix from vB.

    1. Edit bbcode_attachment_list template

    Change:

    Code:
    <a href="{vb:raw attachurl}{vb:raw attachment.nodeid}">
    to:

    Code:
    <a href="{vb:raw attachurl}{vb:raw attachment.nodeid}" [COLOR=#FF0000]target="_blank"[/COLOR]>

    2. Create a template hook in footer_before_body_end hook location with this script to dynamically add link target. Similar instructions on how to create a template hook can be found on one of my mods in my signature below.

    Code:
    <script>
    (function($) {
        $('.b-post-attachments__item a').attr('target', '_blank');
    })(jQuery);
    </script>
    #2 is the recommended solution. Editing templates (#1) is not recommended for maintenance reason. Your template changes might get overridden during upgrades or may have merge conflict that you have to resolve.

    GIPHY for vB5 AutoLinker Auto-Create Flag Report INITIALS AVATAR (Better) Name Card Quote Selected Text Likes Summary Disable AJAX Pagination Stop Links in Posts...& MORE!

    Comment


    • #3
      Any idea if this is an improvement request via jira, yet?

      This is a nice idea.
      adktramping ~ my happy place.

      "Whoever said practice makes perfect was an idiot. Humans can't be perfect because we're not machines." ~ Sam Gardner.

      Vote for your favorite feature requests and the bugs you want to see fixed.

      Comment


      • #4
        Thanks Glen, I'll give that a try! (#2)

        Cheers.

        Comment


        • #5
          Originally posted by NumNum View Post
          Any idea if this is an improvement request via jira, yet?

          This is a nice idea.
          Raise it anyway....if it's a duplicate they'll close it and link to the original.
          MARK.B | vBULLETIN SUPPORT

          TalkNewsUK - My vBulletin 5.6.4 Demo
          AdminAmmo - My Cloud Demo

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X