Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

URL targeting from iFrame
https://www.tinywebgallery.com/forum/viewtopic.php?f=21&t=4315
Page 1 of 1

Author:  Sammerdan [ 25. Apr 2017, 16:19 ]
Post subject:  URL targeting from iFrame

Hey there!

Thanks of building this great program!
I've been reading this forum now to figure out my problem, but have the feeling I'm missing something:

for the website: http://mulima.eu/alfa-romeo/
I have a iFrame in the right and want the links inside open in a new tab.

I the iFrame is not in the same domain, but I'm using the "Special case sub domain:"

If I open the iframe I can see the
Code:
<script>document.domain='mulima.eu';</script>
.


So I think I need to use: change_iframe_links="a" change_iframe_links_target="_blank"
because:
"After you have done this you can configure Advanced iFrame like you are on the same domain"

Like shortcode:
Code:
[advanced_iframe securitykey="57806018b9b163779e7807a7b17b7f45cdecb4a7" use_shortcode_attributes_only="true" src="http://occasions.mulima.eu/cgi/voertuigen.cgi?site=voorraadlijst&v=e587da88&merk=Alfa+Romeo&brandstof=&zoeken=Zoeken" id="al1" height="610" width="1000" show_part_of_iframe="true" show_part_of_iframe_x="1" show_part_of_iframe_y="171" show_part_of_iframe_width="320" show_part_of_iframe_height="433" scrolling="no"
change_iframe_links="a" change_iframe_links_target="_blank"]



But, unfortunatly, it still opens inside its own iFrame...

I can't add any other files to the iFrame server, only to the website parent server.

What am I thinking wrong?

Author:  TinyWebGallery [ 26. Apr 2017, 10:37 ]
Post subject:  Re: URL targeting from iFrame

document.domain='mulima.eu';
also needs to be in the parent domain
http://mulima.eu/alfa-romeo/

Enable this in the administration or add
add_document_domain="true" document_domain="mulima.eu"
to your shortcode.

you have
if (/\..*\./.test(document.domain)) {
document.domain = document.domain.replace(/^\w+\./, "");
}

in you code but I don't know it this is enough/working properly.
I tested this and if executed it seems fine. But it is not executed if mulima.eu is called
directly. I don't know if it has to be set again even when it is already set...

I also get a uncaught Syntax Error: Invalid regular expression in your code.

Best, Michael

Author:  Sammerdan [ 26. Apr 2017, 16:09 ]
Post subject:  Re: URL targeting from iFrame

Hey Michael,

Thnx for this!
Yeah, thought that would have been enough, but unfortunately...
Anyways, this helps for the start!

2nd question:
Is there a way to "rewrite" links
for example:

I want this button in the frame link to:
http://mulima.eu/occasionss/

Or even better:
Can I make it open as an iframe inside the http://mulima.eu/occasionss/ ?

(like if you click on a vehicle inside the iframe on http://mulima.eu/occasionss/ )

Greetz,
Sam

Author:  TinyWebGallery [ 26. Apr 2017, 17:22 ]
Post subject:  Re: URL targeting from iFrame

You still have an error in the code;

var change_iframe_links_target = ""_blank"";

you don't have to include ai_external.js to you main page! this is wrong!
Also you need to remove the additional " from the _blank.

Currently you can only rewrite the links by including a custom Javascript.

Best, Michael

Author:  Sammerdan [ 26. Apr 2017, 18:27 ]
Post subject:  Re: URL targeting from iFrame

Okay,
You hit me a little in the blue here...

The ""_blank"" was is the admin --> "modify the iframe" as "_blank" (So no need to add them extra I guess)

For the Javascript, is this something I can arrange in my situation?

And if so, can you help me out here?

And where to I take this ai_external.js out the main page?
Is this the
Code:
<script>
var iframe_redirect_url = "http://mulima.eu/occasionss/";
var change_iframe_links = "a";
</script>
<script src="http://www.mulima.eu/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>

?

Thnx for your help!

Author:  TinyWebGallery [ 27. Apr 2017, 10:15 ]
Post subject:  Re: URL targeting from iFrame

you don't need this at all!

you need

document.domain='mulima.eu';
OR
ai_external.js (in the external page - not in the parent!)

as you have the first solution you are fine here.

Best, Michael

Author:  Sammerdan [ 27. Apr 2017, 10:57 ]
Post subject:  Re: URL targeting from iFrame

Ah okay,

Got it right, now.

Could you maybe help me out with that javascript?
Or a link where I could find that? Have been searching, but couldn't find the thing that would fit.

Thanks ahead!

Greetz,

Author:  TinyWebGallery [ 27. Apr 2017, 13:47 ]
Post subject:  Re: URL targeting from iFrame

This is some jquery where you search the links and then replace the url somehow.

What you also can do is maybe simply use the:
http://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/hide-a-part-of-the-iframe
feature where you place a transparent div with a link..

Best, Michael

Author:  Sammerdan [ 28. Apr 2017, 17:49 ]
Post subject:  Re: URL targeting from iFrame

Hey Awesome!

This is was I needed!
Thanks man!

Have a great weekend

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/