Notifications
Clear all

Possible to change base href when link clicked on within iFrame

10 Posts
3 Users
0 Likes
1,022 Views
Posts: 5
Topic starter
(@zenpig)
Active Member
Joined: 2 years ago

Hi,

I'm testing out iFrame integration with phpBB with the use of a portal within phpBB and would like any links clicked on within the home page/portal, to forward to the forum link.  The example is at wordpress.doll-fan.com where if a link is clicked on on the home page, it does dispaly correctly, but only as long as it is within the iFrame.  An example link within the iFrame as it  currently is is " removed link

 

What I'd like to occur is to have the target be _top on links clicked on within the portal and maintain the same format for the url including parameters so it would to to " removed link /forum removed link   /forum would be added to url to maintain the active/current menu structure within Wordpress.  Any thoughts on how to do this?

 

thanks,

Steve

9 Replies
TinyWebGallery
Posts: 880
Admin
(@admin)
Prominent Member
Joined: 15 years ago

Hi, 

my forum software does remove the links until you have several posts approved. 

I don't understand what you really want. if you like that all links go to the forum - why not changing the links? 

Here is a demo

http://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/change-links-targets

where link targets and even links are changed. Does this fir your needs? 

Best regards, Michael

 

Reply
Posts: 5
Topic starter
(@zenpig)
Active Member
Joined: 2 years ago

The portal is on "home" page of the site at somedomain with the iframe code of....

advanced_iframe use_shortcode_attributes_only="true" src="somedomain/forums/portal" width="100%" height="600" scrolling="no" id="portal_iframe" add_iframe_url_as_param="same" enable_responsive_iframe="true" onload_resize="true"

The forum is displayed under the menu heading, "forum", at somedomain/forum/ with the code of....

advanced_iframe use_shortcode_attributes_only="true" src="somedomain/forums " width="100%" height="600" scrolling="no" id="forum_iframe" add_iframe_url_as_param="same" enable_responsive_iframe="true"
onload_resize="true"

I can change the iframe parameter links for the portal, i.e., everything after ?iframe=, but I want to instead append /forum/ to the actual domain url before the ?iframe=.  The reason for this is so the menu heading of "forum" is recognized as active.  It's a good bet I don't understand the intricacies of this plugin, but any attempt at changing the url before the parameters from within the plugin ends up with the parameters not being added. 

 

Another way to explain what I am wanting is that I can do a rewrite outside of your plugin like...

source url: ^/\?iframe(.*)
target url:  somedomain/forum 

 

which actually works after the fact... the rewrite isn't catching the url your plugin initially creates, but if I refresh the page, it does direct to the page I want.  Clear as mud? 🙂 

 

 

Reply
Posts: 5
Topic starter
(@zenpig)
Active Member
Joined: 2 years ago

btw, I just realized my rewrite example wasn't complete in the target url.  It would be 

source url: ^/\?iframe(.*)
target url:  somedomain/forum/\?iframe$1 

 

Reply
TinyWebGallery
Posts: 880
Admin
(@admin)
Prominent Member
Joined: 15 years ago

Please see my demo again . check:

change_iframe_links_href

Here you can change the href or part of the href for links you define in the setting for the selector. You have to separate the before and after string with ~. If you have defined more than one element above (Change iframe links) please separate the different href patterns with |. E.g. "www.test.com~www.test2.com|prefix.~" will change www.test.com to www.test2.com and for the other link prefix. will be replaced by a empty string and therefore removed. If you want to append a string to existing links you can use append as the before part. e.g. append~?conf=1 will append ?conf=1 to all links defined in the selector. This setting does also work for elements which are later added to the website by ajax! Shortcode attribute: change_iframe_links_href=""

there you can exchange some pars of the url. so if you have a fix pattern before you can att /forum/ there.

Does this work for you?

Best regards,

Michael

Reply
Page 1 / 2