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

Iframe Links
https://www.tinywebgallery.com/forum/viewtopic.php?f=21&t=4328
Page 1 of 1

Author:  BaileyScott [ 13. May 2017, 13:01 ]
Post subject:  Iframe Links

Hello folks,

I've purchased the advanced iframe pro. I got it working but I'm having some problems.

My website page is: https://comcap.uk.com/monitoring.

Within this page I have an iframe that I've placed using the advanced iframe pro plugin.

The page in the iframe is https://monitor.comcap.uk.com/autologin

The https://monitor.comcap.uk.com page is basically a dashboard which users can click in. For example one of the dashboard "links" is https://monitor.comcap.uk.com/monitoring/#!/hashtags/detail?h=opsview

So every time the users clicks on any link in the dashboard (https://monitor.comcap.uk.com/autologin) I want it to open INSIDE the iframe and not in a new window as it does now.

I have read the instructions but I'm obviously too stupid to make it work! LOL

Can anyone help?

So in summary:

Main page: https://comcap.uk.com/monitoring
Page in the iframe: https://monitor.comcap.uk.com/autologin
Links within the iframe: https://monitor.comcap.uk.com/monitoring/#!/hashtags/detail?h=opsview

Thanks!

Bailey

Author:  TinyWebGallery [ 15. May 2017, 09:26 ]
Post subject:  Re: Iframe Links

The problem is that the links look like:
<a target="_blank" href="../monitoring/#!/hashtags/detail?h=opsview" class="hashtagcell-anchor">

you need to change the target="_blank" with the plugin.
As you are on a subdomain I recommend you read the tab "external workaround" the upper section. The you can modify the targets like shown in this example:
http://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/change-links-targets

Best, Michael

Author:  BaileyScott [ 15. May 2017, 10:52 ]
Post subject:  Re: Iframe Links

Hey Michael,

Is this right?

[advanced_iframe securitykey="<removed>" src="https://monitor.comcap.uk.com/autologin" use_shortcode_attributes_only="true" height="500" width="1200" show_iframe_loader="true" show_part_of_iframe="true" show_part_of_iframe_x="48" show_part_of_iframe_y="114" show_part_of_iframe_width="1140" show_part_of_iframe_height="300" add_document_domain="true" document_domain="comcap.uk.com" change_parent_links_target="a#link1|a#link2" change_iframe_links="#iframe-navigation a" change_iframe_links_target="_parent"]

The link:

/monitoring/#!/hashtags/detail?h=opsview

doesn't appear to have an id tag so I'm not really sure what to put in "change_parent_links_target".

Your help is greatly appreciated.

Thanks,

Bailey

Author:  TinyWebGallery [ 15. May 2017, 11:28 ]
Post subject:  Re: Iframe Links

No.

1. in the iframe you have added document_domain="comcap.uk.com"; without <script> </script>
<script>document_domain="comcap.uk.com";</script>
is what you needed.

2. remove change_parent_links_target="a#link1|a#link2" ypu want to change the linke IN the iframe not of the parent.
3.
change_iframe_links="a.hashtagcell-anchor"
change_iframe_links_target="_self"
is what you can try. hashtagcell-anchor is the class of the link. as you want to change all of them this is maybe enough. and _parent open in the same page not inside the iframe _self is right here.

Check the Javascript console. It will tell you basic configuration errors (F12 in chrome)

Best, Michael

Author:  BaileyScott [ 15. May 2017, 12:02 ]
Post subject:  Re: Iframe Links

Hey Michael....

The error is now:

Uncaught DOMException: Failed to set the 'domain' property on 'Document': '' is an empty domain.
at https://comcap.uk.com/monitoring/:205:897
(anonymous) @ (index):205

The config is now:

[advanced_iframe
securitykey="<removed>"
src="https://monitor.comcap.uk.com/autologin"
use_shortcode_attributes_only="true"
height="500"
width="1200"
show_iframe_loader="true"
show_part_of_iframe="true"
show_part_of_iframe_x="48"
show_part_of_iframe_y="114"
show_part_of_iframe_width="1140"
show_part_of_iframe_height="300"
add_document_domain="true"
change_iframe_links="a.hashtagcell-anchor"
change_iframe_links_target="_self"
<script>document_domain="comcap.uk.com";</script>
]

Any ideas?

Thanks,
Bailey

Author:  TinyWebGallery [ 15. May 2017, 13:41 ]
Post subject:  Re: Iframe Links

<script>document_domain="comcap.uk.com";</script>

need to be in the html of the iframe!!!

in the shortcode is
document_domain="comcap.uk.com"
fine.

Best, Michael

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