Closed (fixed)
Project:
Embed widgets
Version:
6.x-2.0-alpha1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2008 at 14:59 UTC
Updated:
19 Jun 2009 at 01:00 UTC
Do we intend to help users embed forms on 3rd party sites?
For example, imagine a drupal powered commenting service like http://js-kit.com/. The service lets you add a comment feature to any web page. So we'd have to embed reading of comments (easy - use Views) and writing of comments (hard - requires some authentication). Would embed widgets help with the writing comments?
Comments
Comment #1
jtsnow commentedYes, this is definitely a feature that I've planned on adding in the future. I haven't had time during Summer of Code to implement it.
Comment #2
moshe weitzman commentedOK, great. If you have any ideas on how you want it implemented, I may be able to help code it.
I have a client who needs to use Drupal for commenting/rating on his 3rd party CMS. So my use case is easier than most other embed scenarios - client owns both the source and the target web sites.
Comment #3
nedjoYes, the ability to register, authenticate, and submit other forms will be commonly needed.
It looks like the problem breaks down mainly to:
1. Embed forms in widgets--relatively easy.
2. Ensure form submission within widgets works as expected--relatively easy.
3. Control page loading so that page remains within the widget following form submission--a bit trickier.
For 3, the main problem is to override the standard handling of page redirection, which involves (a) a path returned by the last form submit handler, (b)
$_REQUEST['destination']setting, and (c) more perniciously, direct calls todrupal_goto().A trick I've used in the past is to register a form submit handler and in the handler set
$_REQUEST['destination']. That way, even if there is a later form submit handler that returns a path, the explicitly set destination will prevail.Comment #4
freshaspect commentedThis feature would be invaluable for various projects that we are working on at the moment. We are also happy to apply our resources to help out.
Most of the use cases that we are looking at match moshe's in that the client owns both the source and target web sites - and indeed could be hosted on different subdomains of the same primary domain, which would make cookie sharing easier. It all gets trickier when source and target are on different domains.
I will look into getting some detailed use cases together.
Comment #5
jtsnow commentednedjo, For number 3 on your list, would something along the lines of this work?
Then in hook_init(), check if $form['widget_mode'] was submitted. If it was, make sure a widget-compatible of the destination page is rendered.
Comment #6
patchak commentedI agree that this is a great feature. In my case, I would like to see users keep their login information when they browse from one site to another. When they would arrive to a site that already has the widget enabled, their login credentials would be recognized by the widget and they would be able to communicate with the main drupal site, directly from the widget. Is this already doable with the current code?
Comment #7
jtsnow commentedYes, using the current code, your widgets will already recognize users who have logged in to your Drupal site. A widget is a page in the "main Drupal site," it's not a separate program that needs to communicate with the main site.
Comment #8
patchak commentedthat's great, so I guess the new features are more related to passing info to the site, like voting on the current node (on the remote site) or tagging, etc??
Also, the supplemental work needed would be to allow users to actually login to the site and to register from the remote site ? Is it possible to implement that with pop ups for example so that the user nevers leaves the original site while registering or logging in on the site?
thanks again
Patchak
Comment #9
jtsnow commentedLatest version supports in-widget forms, but more thorough testing should be done. Post new issues as bugs are found.