Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author ulfben

    (@ulfben)

    You use the middle click / long click. Every time you force a link to open in a new window, a kitten dies.

    Thread Starter Kah-Y

    (@kah-y)

    Hi ulfben,

    Indeed, the method can work. But I need it work with single normal click instead of middle click / long click, which not really practical to normal user.

    What I need exactly is, to which template file of wp-dtree-30 I should add target=”_new” or target=”_blank” for each node link. It doesn’t matter whether if the node link open in new tab nor new window, as long as it doesn’t open in same window. =)

    Thanks.

    Plugin Author ulfben

    (@ulfben)

    How and where a link opens is up to the user and her browser settings. It’s not something you can or should controll.

    As for what files you need to edit, I’d assume you need to look into the wp-dtree javascript or the wp-dtree-lnk for that.

    Thread Starter Kah-Y

    (@kah-y)

    Hi ulfben,

    I’m glad to have your prompt reply. Yup, I agree with your point. Anyhow, I have to try to make those node link open out of current window =X

    I found if(node.target) str += ‘ target=”‘ + node.target + ‘”‘; in wp-dtree.js, please guide me on how to change it to be target=”_blank”.

    Thanks =)

    Plugin Author ulfben

    (@ulfben)

    str += ' target="_blank"';

    Make sure you look through the entire source though – there may be several places for constructing the anchors. You want to catch them all.

    Thread Starter Kah-Y

    (@kah-y)

    Hi ulfben,

    I tried with replace that line, unfortunately, I failed to get the effect. Perhaps I might be failed to catch them all haha. I really appreciate your help on this =)

    I think I will stop this here, and leave it intact. Thanks you =)

    Plugin Author ulfben

    (@ulfben)

    Hm. Make sure you clear the cache to. You can do that by simply adjusting the widget settings (switch anything on and off again). Every time the settings change, the cache is cleared. (its also cleared whenever you publish something)

    Also make sure you clear any wordpress caching plugin etc.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: WP-dTree] Open node in new window’ is closed to new replies.