The MU forums have moved to WordPress.org

"open link in new window" .. not working / arguments get removed! (16 posts)

  1. berniq
    Member
    Posted 16 years ago #

    i just upgraded from wpmu 1.0 to 1.2.3 and i realized that in "visual editor" the link with "open in a new window" is not working correctly.

    the correct code (TARGET=_blank) is written as html source, but after saving the post the argeuments (title also) are removed automatically.

    any ideas ?

  2. berniq
    Member
    Posted 16 years ago #

    just read here http://trac.mu.wordpress.org/changeset/1022
    that <A ...
    does not allow a TARGET as argument
    ?!?

    why ? it visual editor there is an option "open link in new window" or the same ?!

    what append ?

  3. berniq
    Member
    Posted 16 years ago #

    i put "TARGET" as an possible match into wp-include/kses.php to solve this problem.....
    ..

    but why did you remove TARGET ? i think opening a website in an new window is sometimes a good thing :)

  4. moose123
    Member
    Posted 16 years ago #

    Has there been a solution for this problem? It seems like a fairly major issue to not be able to open links in new windows. I appreciate any help here.

  5. ekusteve
    Member
    Posted 16 years ago #

    You can fix it on your install by opening wp-include/kses.php and adding 'target'=>array(), to the code like below...it's near the top of the file.

    'a' => array(
    'href' => array(), 'title' => array(),
    'rel' => array(), 'rev' => array(),
    'name' => array(),'target'=>array(),
    ),

    Steve

  6. ppriede
    Member
    Posted 16 years ago #

    Maybe here is the answer

    "HTML 4.01 deprecated the target attribute which could be used with links so they would open in a new window"

    http://www.texastar.com/tips/2004/target_blank.shtml

  7. theapparatus
    Member
    Posted 16 years ago #

    It's 2004 but it's news to me. Strange as usually that bit passes the w3.org validation.

  8. plusarquitectura
    Member
    Posted 16 years ago #

    what do we have to do if we want to open a link in a new window, then?

  9. andrea_r
    Moderator
    Posted 16 years ago #

    Right click on the link. Choose "open in new window".

  10. plusarquitectura
    Member
    Posted 16 years ago #

    That's not a solution at all, andrea_r ¬¬ but maybe I should reformulate my question:

    What do we have to do if we want to open a link in a new window with just one left click, just as we used to use "target=_blank" tag?

  11. andrea_r
    Moderator
    Posted 16 years ago #

    up a few replies, ekusteve has already given the answer.

  12. plusarquitectura
    Member
    Posted 16 years ago #

    thanks Andrea_r,

    But I thought that's not a solution, because it seems that it has been deprecated... Isn't there any other equivalent to it?

    I have, however, edited /wp-includes/kses.php file, with this content:

    $allowedtags = array(
    'a' => array(
    'href' => array(), 'title' => array(),
    'rel' => array(), 'rev' => array(),
    'name' => array(),'target'=>array(),
    ),

    I have uploaded the file to my server, but when I add the "target" value, and edit again, I realize that it has been ignored and the link doesn't open in a new window.

    Did I do something wrong?

    Thanks

  13. plusarquitectura
    Member
    Posted 16 years ago #

    I have created a webpage with only a link with target='_blank' value and it is W3C valid. I assume the cause of the error is something else? what can it be? and more important: How can I solve it? I really need to open certain links in new windows...

  14. Vimm
    Member
    Posted 16 years ago #

    I think it's silly how target is "deprecated", yet there's no alternative. How are sites using frames supposed to work? How are we supposed to open links in new windows? Sure you can do it with JavaScript, but this is HTML!

    The target attribute is valid HTML 4.01 Transitional since Transitional includes deprecated elements. It is not valid HTML 4.01 Strict.

    Some users have complained about this so I'll try out ekusteve's code change on my installation.

  15. MrBrian
    Member
    Posted 16 years ago #

    To be honest, i agree. But the filtering is only happening during blog post operations. This only affects a blog writer's ability to allow their links to open in a new window.

  16. plusarquitectura
    Member
    Posted 16 years ago #

    This only affects a blog writer's ability to allow their links to open in a new window

    But that's the aim of a blog, right? If I am using a blog I may not be an html genius and I may want to link other sites. What am I to do with it? And most important... if I don't know html it's even more likely that I won't know javascript...

    Isn't there any real solution to this?

About this Topic

  • Started 16 years ago by berniq
  • Latest reply from plusarquitectura