Fork me on GitHub

Hook Module Suggestion...  Bottom

  • Here is a neat idea for a hook module. Have it so that it checks the links on a page and if the link is local (either a relitive link, or declared within the same domain as the site) it opens in the same window, but if t is a remote link to a differant server it gives it a target="_new" or whatever the code is. This would be good for keeping your users local without haveing to recode every link on your site.

    Any Takers?

    Take Care,
    Mike
  • Personally my opinion is that you should never open a link in a new window. The target attribute of the anchor tag only exists for the HTML 4.01 transitional doctype with good reason. Under all other doctypes e.g. XHTML you can't (and shouldn't) open a link in a new window.

    Why? Where a link opens is down to the user not the site admistratrator. For example if in IE if you right click on a link you get two options open and open in new window. If you add the target attribute then both options behave the same breaking the default behaviour of the browser. There are also accessibility issues regarding opening of links in a new window.

    As someone that uses a tabbed browser it really annoys me to see a site where the site admin has decided that they think that I want a new window when I don't...... In short feel free to develop this solution yourself but I wouldn't recommend this to anyone.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • I can see your point, as I am just now playing with Firefox for the first time ((wish there was a way to make the open in new window open in new tab instead, but that is something to sugest to the Moz people I guess)), but at the same time I wish there was a good solution. I just feel that feeding users off to other sites without keeping one of their feet in my site is a little counter productive. I know I won't be programming any mods like this any time soon, simply because I can barely get through a simple block icon_smile I can adjust modules, but making new ones I don't know where to begin yet.

    Oh well, I guess I will work on dreaming up another solution.

    Take Care,
    Mike
  • I love triing to open a link in a new window, and getting a window with "Javascript:window.open" as the URL
  • If you REALLY want a new window, why dont you put a layer on top of your document, with a [X] in the top corner, that will hide it. Just put a iframe in the middle of it, and go butt wild.

    This works good for login prompts.
  • The fundamental point is that it's not the decision of the webmaster or site designer on how the web is viewed but the end user. A further example of why opening a link in a new window is not desirable is the back button provided by every browser. During the normal flow of browsing if you want to get back to the previous page you can click the back button to move back through the page history. If you force the user into a new window you instantly break one of key features of a browser.

    This maybe ok for you since you know that the previous page is a window behind since you designed the site to do this. Put yourself in the postion of someone whose not visited that site before.... Further put yourself in the postion of someone not using a browser but assistive browsing technology (e.g. a screen reader).

    Rather than my explaination of the issues see Dive into accessibilty. This superb reference covers many of the issues that web designers need to be aware of when designing a site to maximise their possible audience for a site.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • The funniest part about this whole discussion is that if you click the link in Mark's post it will open a new window for you to view the 'Dive into accessibility' page :)

    Of course Mark didn't write the forum code so we'll forgive him :D

    -Chris
  • It doesn't for me, but that could be because I'm not done tweaking FireFox againg after upping to 1PR1. I used to have it set up to open any external link in a new tab, regardless of if it was supposed to or not, I must have it configured to not open in new window. Gotta dig in and find that again.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • I'm using a default install of FireFox 1.0 Preview and it opens them in a separate window. What happens in IE I don't know and don't really care :D
    Personally I don't have a problem with it spawning a new window since I know that if the back button is disabled that it must have been spawned so I just close the window and my old window should be right there staring me in the face.
    Off Topic: If you haven't tried the Mouse Gestures extention to FireFox you should. Opening links in a new tab or a new window becomes really easy.

    -Chris

This list is based on users active over the last 60 minutes.