Open external links in frameset
kadarusj - April 9, 2007 - 23:42
| Project: | External Links |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | zeta ζ |
| Status: | needs work |
Description
Jeff/Nate,
I had worked on a similar project on 4.7 for a client of ours www.lime.com
In fact if you look at their site, and click on any of the external links on there, it would open up a frame page, with two frames. Basically it has the same functionality as some of the external links for about.com
In any case, I would like to contribute, if possible to make the framed page as perhaps as an option that could be part of the settings for this module.
Let me know. Great job by the way. Great contribution.
Jason K

#1
Hi Jason, sure this sounds like a desirable feature. Though it's not really an IFRAME is it? It's just a frameset with the bottom frame containing the linked page. Perhaps we could make a radio list which chooses the behavior for external links:
( • ) Open in same window
( • ) Open in new window
( • ) Open in split frame
Split Frame Contents:
[ Text area for the contents of the iFrame ]
Split Frame Height: [ 200 ]
Enter frame height in pixels.
Provide a menu hook for the iFramed page. So the user wouldn't ever need to actually create an HTML page defining the frameset, it could be provided by a theme_ function. Anyway... it sounds like a neat idea. Post a patch and I'll review. Thanks!
#2
Good idea, any news, release or patch , thanks
#3
This looks like a great idea! I know little to nothing about how one would execute this, though I am more than willing to provide testing and anything else anyone brave enough to take this on might need. Let me know.
#4
#5
Subscribing
#6
Anyone willing to give this a try?
-Victor
#7
Wish I knew how to do this - it'd be first on my list, I know.
#8
I am willing to chip in $$ for this. So if anyone is willing to take a bounty let me know.
Thanks,
Victor
#9
I’d be willing to take this on.
I’ve had a look at the module, and made a couple of minor patches.
Are Victor and the maintainers happy with this?
#10
Sorry, forgot to mention that patches are for 6.x. I’ve left this issue at 5.x because I guess that is what is needed, but I will do 5.x & 6.x.
Also can this code be removed from 6.x now that jQuery 1.2.3 is default?
#11
Hi zeta! Thanks for the *excellent* set of patches! They all look great, however, let's tackle all those in separate issues and keep discussion here focused on the frameset problem. I'll comment further on your patches once they're in separate issues. I really, really appreciate the patches, I just don't want this to become a general purpose forum for fixes in Link module.
#12
Zeta,
Thanks for the quick turn around on this. Unfortunately I am not a programmer so I will stay away from commenting on the patch, looks like QuickSketch is doing a good job validating it.
Can you possibly send me a link where I can see this patch in action? My needs are for 5.x . Also what would appear on the top frame? Can the data for the top frame be shared with the header of the theme (I am using Garland)?
Thanks,
Victor
#13
Hi Victor,
Well it should do what you want it to do ;-) ... it’s not finished yet. The above are some contributions while I was looking at what would be involved.
I’m now working on the actual issue itself. If we compare with the other options;-
I thought the new option would be;-
So it would be possible to also provide;-
This will be more difficult, as it involves extracting just the header, but it is possible.
Nick
#14
I’ve got a setup which can do the following;
Unfortunately, I havent yet managed to get jQuery to detect whether its page is in a frameset or not, so modifying external links is one or the other at the moment.
I’ll set it so that you can open a frameset with a custom link to
frame/int_path/--/ext_paththen all external links in the pages open in the frame replacing ext_path.Will post a patch…
#15
Initial patch against -6--1 Does it also apply against 5-1 ?
Found a jQuery plugin that helps with cross-frame DOM, but might be overkill for detecting page is in frameset.
#16
I have now managed to get jQuery to detect whether its page is in a frameset or not.
If it is in a frameset, external links will open the external page in the other frame without reloading the rest.
If not, external links will open the frameset, and load the current page in one frame and the external page in the other.
This patch is against -6--1: Does it also apply against 5-1 ? If not, I’ll do another patch.
#17
A couple things here:
1. When using the open in frameset option, external links will always go to frame/node/--/[link url without http://] for me. This happens in both Safari and Firefox. Are you using a different browser?
2. The frameset should be in a theme function since it outputs HTML.
3. I think the original request of this was to make an About.com style exit. Where a small header representing the original site is shown at the top. The content inside of this frame would likely need to be another theme function.
Anyway, the primary goal of opening in a frameset still isn't working. Don't worry about a 5.x patch I can port it once this is working.
#18
Patch includes my attempt at theme function, but it doesn’t return anything … yet.
#19
This was a patch I cooked up awhile back when I saw Victor's message on Drupal's forum. I had not received a reply from Victor at the time and was just trying it out. When Victor's reply came only found out that a patch has been posted by Zeta. Nonetheless, I'm posting the patch here and hopefully it can complement what Zeta is doing.
Features are as outlined by quicksketch in #1; patch is against 5.x-1.x-dev
#20
OK, I’ve worked out the problem with theme functions in D6 – I had module_hook where it should have been hook …
You can now choose an iframe, surrounded by your theme; header, footer and other blocks that can be controlled in admin as usual.
Or an old-fashioned frameset with the referring page in the top frame and the external page in the bottom frame by default. External links in the referring page open in the bottom frame, replacing the existing content.
Both options themeable with template files. Let me know if this is anything like you were expecting.
@Nate Thanks for looking after this, let me know if porting to D5 is not trivial.
@edkwh Sorry for any duplication; I’ve looked at your patch, but I’ve used a slightly different method to get the header etc. around the external content (hint cf. print and return in theme functions).
#21
Guys, I am still very interested in this feature. Let me know what I can do help you all (testing?).
-Victor
#22
I tried to run the patch on extlink-6.x-1.6.tar and got this error:
Macintosh:extlink adam$ patch -b < ext_frame-6--1_1.patch
patching file extlink.js
Hunk #1 succeeded at 65 with fuzz 2.
patching file extlink.module
Hunk #2 FAILED at 33.
patch: **** malformed patch at line 135: Index: extlink/frameset.tpl.php
#23
I patched the version from
Macintosh:~ adam$ cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout contributions/modules/extlink
and got the same error.
I applied the patch manually (I may have made a mistake) and my external urls go to:
http://localhost/iframe/www.google.com
which comes back as not found.
Adam
#24
Wow this patch has a lot of crazy (as in neat) functionality. Overall it's looking really good and well written. It's great to see some custom .tpl.php files in Drupal 6! Oh how we love the new theming system :)
Comments:
- The .tpl.php files and menu paths should all begin with extlink, so we don't have name-space conflicts with other modules (iframe module? Who knows...)
- The default frameset.tpl.php files could probably provide a better default for the page titles, printing out the title of the site would be good, we definitely don't want to put "Drupal" right in the title of the page by default.
- The .tpl.php files need a description of all the variables that are made available to them by default. See any of the .tpl.php files provided by core modules for a good example of documenting .tpl.php files.
- For options, I didn't understand what the difference was between "A new frame (in a page)" and "A new frame (split window)". Could we change these to "In an iFrame" and "In a Frameset"
Functionally, this all works great. I'm most afraid of new support requests it will generate regarding "How do I customize this to do X" questions. We can minimize this significantly by providing a plethora of documentation in the code.
After this patch is finished, we can polish it with a little bit of additional JavaScript for the administration page. We should hide the options for "Height of frame for external links:" and "Width of frame for external links:" options if their corresponding option is not selected.
#25
Thanks for your enthusiasm :-) I’ve addressed all your comments, so this should be much better.
#26
Removed code for internal links, and protocol.
#27
Added some comments to explain what’s going on.
#28
Looks good enough to me for an initial commit. The important part is that the .tpl.php is in it's final form (looks good now).
I've got a small concern about the URL structure, especially using '--' to separate the URL. Is there a limitation somewhere that we couldn't use a GET parameter? a la
?url=[encoded url]?Regardless, I'm fine with committing as-is for now. We do still need to port to 5 though.
#29
Will you post here when you commit so people can download the cvs version?
#30
version using $_GET[]’s to do the parsing.
#31
I know I attached this…
#32
I applied the patch on 5.x.1.6. But not sure what to put in configuration page, frame content text box. The open in split frame leaving the box empty does not open the external links at all.
#33
Which patch? the one with a 6 in the name?
#34
The one in #19 for 5.x
#35
Can this be implemented as a new release?
#36
is exist any correct patch for D5
#37
Oh! would love to see this feature on a 6.x release. :-)
#38
I second that. Would love to see a new 6.x release. thanks.
#39
subscribe
#40
Add me to the list that would love to see this for 6.x.
#41
Again, why is this still not committed into 6.x?
#42
At the time, the Drupal 5 module was still supported so the two modules were maintained in sync. Now I think it's best to just let Drupal 5 go its own way and stop adding any new features to that branch. Now it's a matter of rerolling this patch (it doesn't apply any more) and giving it another review.
#43
Subscribing
#44