Open iFrame url in a new tab?

I have an iFrame in my main page. There’s another element on the page that’s a link. Can I make this link take the url of the iFrame and open it in a new tab? Basically if a user changes pages on the iFrame I would like this link to take wherever they are in the iFrame and pull that page into a new tab.

Doable?

I don’t believe you can access the iframe’s current URL using native Axure methods. You might have to insert some JavaScript to accomplish it.

@Paul posted a solution, you find it in the following thread.
Iframe target and variables

Thanks,
Vikram

Hi R082,

If your Inline Frame is linked to a page within your project, this should be pretty easy. You can create a Global Variable–let’s call it “page”–and then use the OnPageLoad event of each page to load the page name in to the variable. Then to open the current iframe page in a new tab, you can link to:

[[page]].html

The result is that you could go and do flow throughs via the Inline Frame and open the current page in a new tab.

But if you are looking at external pages in an iframe, you couldn’t natively grab the URL.

Hope this helps!

Yes I would be looking at external pages in the iFrame. As the user browses the external url through the iFrame they should be able to click a link to pop-out the current page in iFrame in new window/tab.

Hi R082,

Hmm, this is an interesting use case. As Tuomas and nkrisc mentioned, there’s currently not a way to grab or base interactions around the iframe’s target URL if you’re linking to external webpages. If it is possible to build this into the tool, then it may be useful to users such as yourself who need to use this functionality. I’ll go ahead and pass this idea over to product management to see what we can do to help make your workflow easier.

1 Like

I’d love just to have a variable for PageFileName or PageURL. Page name and the actual name of the html file do not always match. I want the ability to open my pages in a viewer I’ve created. But to do that on a per page basis I need the name of the actual url file to load into the url to the viewer.

Hi Tuomas Axure. I’m am using the exact method you describe. Freakishly, however, it works perfectly well when I Preview the file, but get the “This page doesn’t exist.” page when viewing the published version in Axshare, which leads me to believe that when the prototype is in the Axshare environment, perhaps some sort of URL prefix is required before (using your example) [[page]].html? I’m using the latest build of v8. Any suggestions greatly appreciated.

Hi Tuomas, Florie -

I verified that the following (when entered the “external url” fx box for the Open Link command) no longer works in 8 when hosted on Axshare (though it works locally):

[[var_pageName]].html

This, however, does work when hosted on Axshare:

[[var_pageName + ‘.html’]]

So apparently, mixing strings and expressions in the external url field breaks when hosted on Axshare. Weird!

3 Likes

Hi Florie and Joseph,

Thanks for bringing this to our attention. I agree–the underlying functionality seems to go awry when appending .html at the end of an external URL, after the variable, and viewing on Axure Share. And I’ll be submitting a ticket to see about possible ways we can address this better.

Joseph’s workaround definitely looks like it can help for the time being (thanks Joseph!)–it produces good results on my end, too, both when previewing locally and on Axure Share. We’ll look into it!

Thanks, Alex! We’re excited to see what potential solution might arise :slight_smile:

As always, sweet workaround, thanks Joseph!

Hello Alyssa,

is it now possible to do this?
I need this to get the current x and y coordinates and the zoomlevel of the map I linked to the iframe. Maybe there is another possibility? Thanks!

Hi Rebecca91!

I’m afraid there isn’t a native way in Axure RP to get the x and y coordinates/zoom level of the target map through an iframe, but I’m thinking you could get this from the map source, perhaps from a setting or feature you could enable? It still isn’t possible to grab/use interactions around the iframe’s target URL when linking to external webpages, however, I’ll be happy to pass this along to our designated teams if you’d like.