Links in posts open in new tab?
-
Hi Guys! So a little background..I've spent the last 2 days and a total of 22 hours trying to get Discourse to "bend to my will." Then today, exasperated and berated by the nonsensical method for writing plugins, I decided to seek a new horizon. NodeBB will no doubt be that horizon.
OK..so if a user posts the text "http://something", NodeBB automagically transforms it into an anchor element. I'd like to suggest that the link open in a new tab, because currently it opens in the same window and I don't want to pull traffic away from my forum. Should just be as easy as adding the
target
attribute to the anchor element. Example:<a target="_blank" href="http://something">http://something</a>
. -
Edit: forgot my manners welcome to the forums, hopefully Nodebb will be everything you need from a forum platform.
Hotly debated subject and something I have to disagree with. If a user is clicking a link, they want it to open in that window. That is the default behaviour on all browsers on all good websites, the target attribute isn't XHTML 1.1 valid either so it's hacky. Forcing all links to open in a new tab is hugely annoying, as clicking the back button would do nothing, this is bad UX and should be discouraged unless absolutely necessary. (When filling out a form for example, and even then, tooltips are a better option).
If someone wishes to open links in a new tab, then they can right click that link and tell it to open in a new tab, or a new window. Alternatively Shift+click will achieve the same thing.
However, in your profile settings is an option to open outgoing links in a new tab. It is off by default for each user and is set by each user in their settings, if they want it, it's there. pro tip: you can edit other people's settings to turn this on for them if they have specifically requested that feature.
I could go on and on about why it's discouraged, but it all boils down to this point here
I don't want to pull traffic away from my forum.
If your forum is worth reading, they'll click the back button, forcing members to stick around via bad UX will result in frustration and a high desire to close the website altogether.
-
However, in your profile settings is an option to open outgoing links in a new tab. It is off by default for each user and is set by each user in their settings, if they want it, it's there. note: you can edit other people's settings to turn this on for them if they have specifically requested that feature.
Well derp--I didn't even see this option. sheepish grin I'll be sure to tell my users about this feature! Thanks for giving me an answer + your philosophical thoughts on the subject. I've considered the UX flow a few times and have discovered that most people prefer sites to open in a new tab. There are many reasons--but the main one is convenience. Instead of loading the initial page, clicking the link to load a new page, then clicking the back button to load the initial page again--it's reduced to two page loads.
Just my view on things. Thanks again for the help!
-
@Jacob-Bridges no problem buddy, I've used it myself on occasion, so can't claim to be as highly philosophical as I make out. But i don't believe developers/designers should be forcing non default browser options like target attributes on users. then again, people have argued about it for years, so it's not going to be definitively resolved anytime soon.
Let us know if we can be of any more help, NodeBB are currently hosting a competition, if you're looking at writing plugins, you've joined at a great time.