WordPress.org

Ready to get started?Download WordPress

Forums

Auto target="_blank" ?? (57 posts)

  1. Beel
    Member
    Posted 10 years ago #

    Retract those fangs VK! The initial question was limited to "within the blog content" besides WP focuses on web standards and the support should therein reflect such. Would an artist instruct someone on how to deface his or her artwork? Of course not! This is IMnotsoHO ;-)

  2. Anonymous
    Unregistered
    Posted 10 years ago #

    Fangs away. Sorry about that - sometimes they pop out for no particular reason.

  3. Anonymous
    Unregistered
    Posted 10 years ago #

    Just my two cents: Those "purists" at W3 C are serving a greater and in my view
    more important purpose. No code of any description is likely to meet with their approval unless it is accessible. External links do not meet with that criteria. Beside which; no one forces you or any one else to validate at all. But you can't chose to join a "religion" and then alter its faith.

  4. Anonymous
    Unregistered
    Posted 10 years ago #

    In that case ebart, you would have to use preg_replace to find and replace links with rel="external".

  5. ebart
    Member
    Posted 10 years ago #

    Thanx Mark, but rel="external" isn't a very good idea either. You can find an explanation in a post I made earlier in this discussion.
    I found a link that explains proper ways to open links in new windows and still remain standards compliant:
    http://www.accessify.com/tutorials/standards-compliant-new-windows.asp
    Of course I already hacked WP so that the add-link-javascript adds a target="_blank" automatically. That's not the point. I'm trying to say that it would be a nice feature to include in WP by default. Of course people should have the freedom to turn it on or off depending on their needs.

  6. OperaManiac
    Member
    Posted 10 years ago #

    if it happens wp would become non xhtml compliant out of the box. :)
    totally unacceptable ;)

  7. ebart
    Member
    Posted 10 years ago #

    Incorrect!
    Xframes is an official W3C standard to enable frames and the target attribute for XHTML:
    http://www.w3.org/TR/xframes/
    It's deprecated in XHTML itself because XHTML will have a modular aproach to features like frames and targets.
    I don't know who started the tale about frames and the target attributes not being standards compliant anymore. It's not true! It's not deprecated! They just changed it to a module!
    Look at me getting all emotional about it... ;)...

  8. OperaManiac
    Member
    Posted 10 years ago #

    well the fact is that i use target and the validator generate errors like anything... until there is an alternative. no targets for me :)

  9. Anonymous
    Unregistered
    Posted 10 years ago #

    Hi there,
    I have been reading up on all this 'new window- same window' issue and have been totally confused. After much consideration, I think I should take out all target_blank references in my site but this is where the big issue comes in for me.
    How do you do that?
    I mean I am probably talking over 100 references riddled throught the site in posts, comments, links - everywhere.
    Is there an easy means or is the only option to do it manually? Any help would be much appreciated :)

  10. Anonymous
    Unregistered
    Posted 10 years ago #

    All things aside, I edited the index.php:
    <div class="storycontent">
    <base target="_blank">
    <?php the_content(); ?>
    </div>

    I just added the "base target"-line, and only the links in the blog-section open in a new window.
    As for the standard-compliance... This should do the trick in most cases ;)

  11. Anonymous
    Unregistered
    Posted 10 years ago #

    Just to note:
    target=_blank for everything wouldn't be a good idea. It would really bug the heck out of me if I got a new window every time I clicked on a link in my blog.
    However, that being said, I see absolutely no reason why I shouldn't have my blogroll open in a new window for each click, and not a _blank one but one different target for each site.
    I also happen to visit a lot of news blog sites and clicking on each news item and getting a seperate window for each article is something I simply can't do without. I'm a columnist and I value having 20 articles open at once.
    Okay, so I use Konqueror with tabs and each new windows is opened in a new tab, which keeps it nice and neat, and I haven't seen a pop-up in over 2 years because of smart javascript in Konqueror (literally). But that makes me smart for not using IE (I know Mozilla/Firebird/Firefox does this too as I sometimes use that as well).
    Targets are great for some purposes, like mine, and I really don't see why I should have to deal without them. :)
    So, that being said, does anyone know how to make a specific ID target for a blogroll link? When it comes to posting my own news item links (to AP stories and the like), I simply give each one a unique name by hand when I'm writing, which is fun enough on it's own anyway.

  12. Anonymous
    Unregistered
    Posted 10 years ago #

    And before you post: "You're a columnist but you misspelled 'separate'! Ha!", I just want to say that it's 2am and sometimes, at this late hour, I don't really care how badly I type when I just want to go to sleep. :)

  13. DaveyWavey
    Member
    Posted 10 years ago #

    Odd. I added <base target="_blank"> under <div class="storycontent"> in index.php and the first post works fine - in the sense that links in the story content pop open a new window, but category and more... links don't. But then... menu links open a new window too and category and more... links in stories below the first link also open new windows. Strange huh? Any idea what I could have done wrong?

  14. Anonymous
    Unregistered
    Posted 10 years ago #

    If you don't mind using javascript, you can use this: link text.
    I'm surprised someone dug up this old thread.

  15. Stevarino
    Member
    Posted 10 years ago #

    I'm suprised someone did this too... Anyway take advantage of my insomnia if you're going to be all uppity about it. ;)
    Pop-up Entries Hack
    If there's enough interest I could port it to a plugin...

  16. DaveyWavey
    Member
    Posted 10 years ago #

    I Tried notepad and wordpad and all I get is a
    Parse error: parse error in /home/virtual/site45/fst/var/www/html/my-hacks.php on line 14
    Am I a dumb ass or what?
    Nice hack though Stevearino - if i can get it to work :(

  17. Anonymous
    Unregistered
    Posted 9 years ago #

  18. canbebesi
    Member
    Posted 9 years ago #

    The quicktag change only applies to future posts.
    It basically alters the auto tagging of the link.
    For the past posts you would have to manually edit if you wan tto do it this way.

  19. massive
    Member
    Posted 8 years ago #

    I could use some help with the supplied js posted earlier in the thread:

    ffunction setTarget(target)
    {
    l = document.links
    for(a = 0; a < l.length; a++)
    {
    lnk = l[a]
    ln = lnk.hostname + ':' + lnk.port
    lo = document.location.hostname + ':' + (document.location.port?location.port:80)

    if(ln != lo) {
    // link is external. set the target
    lnk.target = target;
    } else {
    // link is local. Don't need to do anything. But if you want
    // special handling for local links, here's where to put it.
    }
    }
    }

    setTarget('ext_link_window');

    this solution is perfect for me- I cant get it to work- some help for a js nub?

  20. Kahil
    Member
    Posted 8 years ago #

    WOW... I'm still astounded as to the level of rudeness that is allowed in this support forum....keyword = support...

    if you have firefox, the _blank target isn't bad, it just opens a new tab and it prevents ads and popups...so i don't see why its such a big deal...

    I think it would be a great idea to have an option that would let you select how you want to handle links in your blog. remember if its an option, those who want to use it can and those of you who have been so rude about it don't have to...

    again, i think it'd be a good idea to have the option to make all external links open in a new window/tab... cause if you have firefox as your browser, you can veiw the link in someone's blog and still have their blog open for viewing without having to go back... just a convenience IMHO

  21. Beel
    Member
    Posted 8 years ago #

    Kahlil - You have made your point repeatedly - which itself may be interpreted as rude, especially since someone made a post to a year old thread seeking help and you responded, not with help, but again with your "forum is rude" contention.

    And as has been repeatedly pointed out, the _blank target is "bad" for those of us who wish to maintain valid XHTML code - regardless of where it opens in FF or any other browser.

    massive: I posted something in another thread that may be of help and will post back when I find it...

  22. Beel
    Member
    Posted 8 years ago #

    http://wordpress.org/support/topic/6642#post-39860

    It may not be what you are looking for, but it does work for all links with rel="external" in them.

  23. Kahil
    Member
    Posted 8 years ago #

    Beel... I wasn't the one nor am I someone who has gone around here making rude replies to people. I think that this forum may need a little moderation. How is my pointing out someone's rudeness and backing up others in support of a subject rude? I guess its rude to call someone out who'd being a jerk. Anyway, the point is that we come here for help. Not all of us have the experience that you seem to have. Others should realize that and just either offer the support someone has asked for or move on...

    if _blank isn't good to maintain valid XHTML code, then maybe there is a simple work around for it that will give the valid code the experts want and the simple, easy to do funtionality novices want...

    so lets all just play nice

  24. vkaryl
    Member
    Posted 8 years ago #

    Hmmm.... I think I won't address any of that....

    I use a simple inline js that validates in the XHTML Strict that I write code for: onclick="window.open(this.href);return false;"

  25. Beel
    Member
    Posted 8 years ago #

    I posted a similar work around above even though I find popups annoying... unless they are initiated by me with a simple "shift-click".

    Kahil, you have made your concerns known in other, more topical, threads with virtually the same nonspecific comments about how rude this forum is.

    Now for my little attempt at humor: You may have eaten paste when you were four ;-), but like the rudeness you perceive in this thread, it is hardly relevant today. Many of the posters are no longer here, posts are missing, and like the Phoenix, this thread arose from the dead by a poster with a new question. All it needed was a simple answer, not a side comment, and then it could have gone back to the grave. That is all I am saying.

    As for me, I read posts where people state their positions regarding popups and compliance and though they may disagree with mine, I hardly find that rude.

  26. vkaryl
    Member
    Posted 8 years ago #

    I quite agree, Beel....

    Each to hisser own.... I don't use that js for "popups" myself, only for links to sites which need to stand on their own apart from whichever particular site of mine they are linked from.... for instance, I link the USDA Forest Service Campground Reservations site from the local town website I run. Why would I want their site to open in the narrow menu section where the link resides?

    However, I repeat: each to hisser own.

  27. massive
    Member
    Posted 8 years ago #

    Beel!

    Thanks for that help. I like it, its a good solution but I was really in love with the idea of not having to drop in any inline attributes for 2 reasons. 1: I often have non- web savvy friends posting to my site. I'd prefer not to have to tell them to alter the code whether they can handle it or not. 2: I have 4 months or so of archived posts to deal with as well.

    I read that there was an auto insert tool that I could use but I've just taken a full time job and yadda yadda Im so busy...

    I think I'll just bite the bullet and grab that new- what is it- extension? The one that'll include the rel=external attribute in all links? Unless I can figure out the js...

    anyway - thanks- seriously.

    this is me: http://massivemoth.com/massivenet/

    happy halloween

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.