Notifications
Clear all

Possible to change base href when link clicked on within iFrame

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

change_iframe_links_href="" alters the link within the iframe, but that link is part of the url after the default url forward parameter of "?iframe=" when there is no target set... i.e. self.  If this could change the link before the "?iframe=", it would do what I am describing I would like to do.  

When something like "_blank" is used as a target, it does alter the link as well, but the url no longer makes use of the url forward parameter, which is needed for consistency in the links, and also to keep phpBB within an iframe.   

The home/portal page has automatically generated links, which are relative to the location of the actual forums folder, such as "recent posts" from the forums.  On the forum page itself, a post would have a link such as somedomain/forum/?iframe=somedomain/forums/viewtopic.php%3Ft%3D392255.  If that post is showing as a recent topic on the portal page, I can click on the link from within the portal, which will display somedomain/?iframe=somedomain/forums/viewtopic.php%3Ft%3D392255.  The post shows fine within the iframe, but the url needs to start with somedomain/forum/?iframe=.... in order for the nav menu to indicate that the user is now within the forum.  

 

I have been all over that demo previously, and my first attempt was using the change_iframe_links_href="" to achieve what I wanted, but I see no way, and no example given, that shows how to change the parent domain portion of the url while maintaining the exact same structure of the url forward parameter between the pages.

 

Would it be easier to see what I'm trying to achieve by a different form of communication like email?  A forum that strips out the links seems counterproductive to being able to communicate effectively what the issue is.

 

thanks.

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

I can get it close when using _blank as the target and clicking on links from within the portal.  What I seem to be running into is where there is more than one parameter.  For example, /memberlist.php?mode=viewprofile&u=6821 encodes as /memberlist.php%3Fmode%3Dviewprofile%26u%3D6821 when clicked on through a link in the forum, which is just fine.  The same member when clicked on via the link in the portal can't encode the whole thing and I end up with /memberlist.php%3Fmode%3Dviewprofile&u=6821 instead.  

Reply
TinyWebGallery
Posts: 925
Admin
(@admin)
Prominent Member
Joined: 16 years ago

Hi,

changing the link on the parent page is not a feature. I actually don't understand why this is needed. Because you can change the urls on the parent page by your self.  Or can you not do this as you wrote something is generated? So you simply change the generator? 

If you like the change links on the parent you can add some custom Javascript for this. This might help. 

If you forward parameters they need to be encoded! because otherwise this will change the meaning of the link. I don't get the difference how the user clicks. how does the portal get a link like this? 

Best regards, 

Michael

Reply
Posts: 2
(@kristian)
New Member
Joined: 3 years ago

iFrame has a src attribute which specifies the location it shows. As such, it's a simple matter of binding the click of a link to changing that src attribute. The "target" attribute should open in the iframe. Use attribute name

Reply
TinyWebGallery
Posts: 925
Admin
(@admin)
Prominent Member
Joined: 16 years ago

@Kristian: correct. Already part of the plugin. You only need to configure this.

Reply
Page 2 / 2