• When displaying a remote blog post is it possible to set the hyperlink to open the post in a new tab instead of the same window. For links that direct visitors away from our site we like to open in a new tab so they still have our site open and will be back to the browsing session.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Oliver Campion

    (@domainsupport)

    I think we decided not to incorporate this option because it’s not good user experience to try to trap a user on your site by opening a new tab and users are perfectly capable of using the browser’s back arrow to go back to your site should they wish to. There’s also a documented vulnerability with using _blank to open links in new tabs.

    If you’d still like us to add this (we can incorporate a fix for the vulnerability) then we’ll add it to our “to do” list and let you know when it’s done.

    Oliver

    Thread Starter drisko

    (@drisko)

    Thanks Oliver. I’m a novice when it comes to web development but I work in IT and I can fumble my way around code a little. I do recall running across something about target=”_blank” being a problem and the recommendation I saw was to make sure to add rel=”noopener”. On line 176 of the display-remote-posts-block.php in added target=”_blank” rel=”noopener” in the anchor and that seems to work. From a UX perspective (which I only have passing familiarity with) we decided to roughly classify links as primary info that people are visiting the site to get and secondary info that we think is interesting but not what people are coming to find. Secondary links (like remote blogs) are set to open in a new tab. Personally I think it would be nice if there was a toggle in the block settings to allow the web developer to choose same window or new tab much how default WordPress settings allow for other types of links. It may not be best practice but I think there’s probably still a time and place to be able to do it. If I knew a little more I might attempt to figure out how to add it in myself as a learning exercise. Since I have a workable solution you can mark as resolved. Thanks again!

    Plugin Author Oliver Campion

    (@domainsupport)

    Hi,

    I know this has taken ages and I really apologise. I’ve had a lot on my plate recently and going back to remembering how to program Blocks with React JavaScript really didn’t fill me with much delight haha!

    Anyway it’s done and you should find there is a new block control to choose to open links in a new tab.

    Hope it works for you!

    Oliver

    Thread Starter drisko

    (@drisko)

    Thanks, Oliver! I saw a notification come through from my web host that there was an update and saw that you incorporated the switch. Much appreciated! Would love to support your work. On your donations page is there a particular project I should select related to this plug-in?

    Plugin Author Oliver Campion

    (@domainsupport)

    Thanks! I’ve added “Display Remote Posts Block” to the dropdown but here’s the link to auto-select that project ?? VERY MUCH APPRECIATED!!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Open remote blog in new tab’ is closed to new replies.