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

quicksketch - May 5, 2007 - 23:37

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

toma - June 6, 2007 - 18:41

Good idea, any news, release or patch , thanks

#3

StevenSokulski - June 7, 2007 - 19:12

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

quicksketch - November 13, 2007 - 02:12
Title:iFrame» Open external links in frameset
Version:5.x-1.0» 5.x-1.x-dev

#5

vkr11 - January 8, 2008 - 21:16

Subscribing

#6

vkr11 - April 16, 2008 - 06:38

Anyone willing to give this a try?

-Victor

#7

nmorse - April 25, 2008 - 15:46

Wish I knew how to do this - it'd be first on my list, I know.

#8

vkr11 - April 29, 2008 - 23:28

I am willing to chip in $$ for this. So if anyone is willing to take a bounty let me know.

Thanks,
Victor

#9

zeta ζ - April 30, 2008 - 01:41

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?

AttachmentSize
settings.patch 1.24 KB
mailto.patch 913 bytes

#10

zeta ζ - April 30, 2008 - 01:52

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?

AttachmentSize
jQuery_update.patch 1.29 KB

#11

quicksketch - April 30, 2008 - 01:58

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

vkr11 - April 30, 2008 - 05:08

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

zeta ζ - April 30, 2008 - 06:43

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;-

  • replaces the current page with the external page
  • leaves the current page, and opens the external page in another window / tab

I thought the new option would be;-

  • places the current page in top part of a frame with the external page in the lower part

So it would be possible to also provide;-

  • places the header in top part of a frame with the external page in the lower part

This will be more difficult, as it involves extracting just the header, but it is possible.

Nick

#14

zeta ζ - May 1, 2008 - 04:17

I’ve got a setup which can do the following;

  • output a frameset
  • modify external links to open the frameset and load the current page in one frame and the external page in the other
  • modify external links to open the external page in the other frame without reloading the rest

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_path then all external links in the pages open in the frame replacing ext_path.

Will post a patch…

#15

zeta ζ - May 1, 2008 - 11:57
Assigned to:Anonymous» zeta ζ
Status:active» needs review

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.

AttachmentSize
ext_frame-6--1.patch 4.36 KB

#16

zeta ζ - May 3, 2008 - 01:24

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.

AttachmentSize
ext_frame-6--1.patch 4.34 KB

#17

quicksketch - May 3, 2008 - 05:21
Status:needs review» needs work

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

zeta ζ - May 4, 2008 - 06:22
  1. Sorry, missed that change when I was editing the patch file! My dev env is setup better now.
  2. Still working out how to do that. I was following advice in http://api.drupal.org/api/function/page_example_foo/6 to just print the html.
  3. I don't know if www.lime.com or about.com has been re-designed, but I can’t get either to open a frame, pop-up or anything except a new page. Can do this even more simply; but need to work out 2. first.

Patch includes my attempt at theme function, but it doesn’t return anything … yet.

AttachmentSize
ext_frame-6--1-.patch 4.68 KB

#19

edmund.kwok - May 6, 2008 - 01:44

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

AttachmentSize
extlink_external_frameset_5x.diff 4.43 KB

#20

zeta ζ - May 6, 2008 - 06:33
Status:needs work» needs review

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).

AttachmentSize
ext_frame-6--1.patch 6.69 KB

#21

vkr11 - May 19, 2008 - 18:22

Guys, I am still very interested in this feature. Let me know what I can do help you all (testing?).

-Victor

#22

agerson - May 20, 2008 - 22:24

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

agerson - May 23, 2008 - 00:59

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

quicksketch - May 29, 2008 - 20:55
Status:needs review» needs work

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

zeta ζ - May 30, 2008 - 05:42
Status:needs work» needs review

Thanks for your enthusiasm :-) I’ve addressed all your comments, so this should be much better.

AttachmentSize
ext_frame-6--1+.patch 8.16 KB

#26

zeta ζ - May 30, 2008 - 06:21

Removed code for internal links, and protocol.

AttachmentSize
ext_frame-6--1++.patch 7.31 KB

#27

zeta ζ - June 4, 2008 - 03:35

Added some comments to explain what’s going on.

AttachmentSize
ext_frame-6--1+++.patch 8.06 KB

#28

quicksketch - June 4, 2008 - 06:33
Status:needs review» patch (to be ported)

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

agerson - June 5, 2008 - 03:12

Will you post here when you commit so people can download the cvs version?

#30

zeta ζ - June 5, 2008 - 03:21

version using $_GET[]’s to do the parsing.

#31

zeta ζ - June 5, 2008 - 03:24

I know I attached this…

AttachmentSize
ext_frame-6--1_.patch 8.22 KB

#32

wisdom - June 18, 2008 - 14:49
Title:Open external links in frameset» Open in split frame

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

zeta ζ - June 18, 2008 - 15:48
Title:Open in split frame» Open external links in frameset

Which patch? the one with a 6 in the name?

#34

wisdom - June 18, 2008 - 17:58

The one in #19 for 5.x

#35

simx0r - August 3, 2008 - 10:35

Can this be implemented as a new release?

#36

alimosavi - December 27, 2008 - 16:06

is exist any correct patch for D5

#37

JohnNoc - March 15, 2009 - 19:16

Oh! would love to see this feature on a 6.x release. :-)

#38

cgjohnson - April 19, 2009 - 22:18

I second that. Would love to see a new 6.x release. thanks.

#39

zoia - April 20, 2009 - 08:38

subscribe

#40

bacchus101 - April 21, 2009 - 18:47

Add me to the list that would love to see this for 6.x.

#41

dkruglyak - May 18, 2009 - 03:31
Version:5.x-1.x-dev» 6.x-1.x-dev

Again, why is this still not committed into 6.x?

#42

quicksketch - May 18, 2009 - 04:22
Status:patch (to be ported)» needs work

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

DawnLight - May 26, 2009 - 15:27

Subscribing

#44

cgjohnson - June 23, 2009 - 14:51
 
 

Drupal is a registered trademark of Dries Buytaert.