Recent Topics

quicktags target hack

Started by on Jan 14, 2014 – Contents updated: Jan 19, 2014

Jan 14, 2014 10:43    

Short mod to /plugins/_qucktags.plgin.php to incorporate prompt for target attribute for URL in href
This one has target="_blank" as the default.

As the undescrore prefix is hard coded, any user created target window will/must have an id/name beginning with an underscore

PHP

//b2evoButtons[i].tagStart = '<a href="' + URL + '">';
 b2evoButtons[i].tagStart '<a href="' URL '" target="_'prompt('target','blank') + '">';

14 Jan 2014 19:06

Hello @amoun, thanks for your contribution.

Just for information, target="_blank" is object of debate in usability, due is the page who "decide" where the user will open those links and not the user itself deciding how to navigate. As everything, some people like, some people dislike. With or without it, the links will work on almost all the browsers.

The official voice on tech stuff in this field is W3C saying this:

no version of HTML strict has ever included the target attribute

Full link to the page: http://www.w3.org/MarkUp/2004/xhtml-faq#target

As b2evo is XHTML 1.0 (target=_blank supported), everything goes back to the usability field.

Best regards!

19 Jan 2014 15:05

mgsolipa Thanks

Yes I'm aware that it should be user pref, but this was for a specific site and a default [_self] would be better for general consumption.
Still the basis is that a post can open a new tab keeping the source open. Using back isn't always the best option especially when viewing large images on a slow connection.

PS I have updated my skin to be html5 where [_target] is once again a valid attribute :)
Quite a few validation errors I had to sort http://rogerlovejoy.net/blog/b2evo.php


Form is loading...

blog software – This forum is powered by b2evolution CMS, a complete engine for your website.