Links: "Open in new window"

NKBV / 2012-06-03 08:59:34   

Hi guys, just for information: the option for the links "Open in new window", doesn't work. When the link is generated, it missed the target="_blank".

Cheers!

Vaska A / 2012-06-03 09:34:54   

You sure you have it turned on? It's been working perfectly...

Netsvetaev / 2012-06-03 12:32:49   

I have the same problem.

Vaska A / 2012-06-03 12:44:49   

Ok, definitely noted.

britagranstrom / 2012-11-15 20:40:54   

Yes I was just about to come here and post this problem too, it doesn't work.

willard21 / 2013-03-01 04:42:46   

I too am having issues with this!

williamcdunn.com

I am trying to establish a "links" page but I cannot seem to get them to open in a new window or tab without the right click.

Thanks!

bipster / 2013-03-01 11:52:32   

Yep, me too

Vaska A / 2013-03-01 15:22:22   

Show me what you are doing...

bipster / 2013-03-01 15:35:05   

Steps to reproduce:

1. Edit an exhibit
2. Type some text in the textearea
3. Select a word
4. Click the Link Manager button
5. Check the "Open in new window" checkbox
6. Type an url in the "urlemail" field
7. The link is inserted without the "target=_blank" attribute

bipster / 2013-03-03 23:13:38   

Apparently, when clicking the Submit button, Indexhibit is calling the following function:

parent.edInsertLink(edCanvas, 2, enterLink.value, target);

but the edInsertLink() function found in the alexking.quicktags.js file doesn't have a target parameter

willard21 / 2013-03-05 22:58:21   

So then is the "target=_blank" something that we can just manually type into the link for this to function for now?

Thanks for helping to sort this out bipster! This stuff is so far above my head!

bipster / 2013-03-05 23:36:05   

Yep, you can add the "target=_blank" yourself, like this:

<a href="site.com" target="_blank">text</a>

willard21 / 2013-03-06 07:37:58   

Resolved!!

Thanks bipster!

willard21 / 2013-03-08 02:41:51   

I lied... not resolved.

I'm writing it like this without any results:

Klaus Pichler

What am I messing up?

tombland / 2013-03-13 02:39:56   

bipster posted the wrong code higher up this thread.
the first " should not be before target but after =

so the code should be
your text here

any chance of this function being fixed for the Indexhibit download files Vaska?

tombland / 2013-03-13 02:43:14   

well that didn't work, I was trying to explain the code but it ended up making a link, of course.

bipster did get it right in their most recent post, the code posted is correct, even though the use of "target=_blank" in the line above that is incorrect.

Vaska A / 2013-03-13 15:33:25   

I'll take a look at it, but it's working for me.

lemathieu A / 2013-03-13 15:40:35   

Not for me, i just noticed it. I don't have the target="_blank" attribute.

donate / 2013-04-08 20:21:25   

I have the same problem, any new news about it? thanks

cnitsch / 2013-12-31 17:00:52   

any fix on this?
I know how to manually add target="new", but it would save alot of time if that check box worked.

bipster / 2014-03-28 09:12:19   

To fix this bug open the /ndxzstudio/asset/js/alexking.quicktags.js file and replace the edInsertLink function with the following code:

function edInsertLink(myField, i, defaultValue, target)
{
    var target = (target == '_blank') ? " target='_blank'" : '';
    if (!edCheckOpenTags(i)) {
        var URL = defaultValue;
        edButtons[i].tagStart = '';
        edInsertTag(myField, i);
    } else {
        var URL = defaultValue;
        edInsertTag(myField, i);
    }
}

bipster / 2014-03-28 09:15:47   

Oops, the forum screwed the previous code up. This is the correct code:

function edInsertLink(myField, i, defaultValue, target)
{
    var target = (target == '_blank') ? " target='_blank'" : '';
    if (!edCheckOpenTags(i)) {
        var URL = defaultValue;
        edButtons[i].tagStart = '<a href="' + URL + '"' + target + '>';
        edInsertTag(myField, i);
    } else {
        var URL = defaultValue;
        edInsertTag(myField, i);
    }
}

This thread has been closed, thank you.