Here is a module I wrote that opens the user login (user/login) and user register (user/register) into a modal frame. Please review it and modify it as necessary and see if we can add it to the next release of modalframe_contrib.
This is a useful module because it relies on a login block and there are no redirections after login or logout (except for a javascript-fired page refresh after login).
Instructions:
Depends on modalframe api module
unpack into sites/all/modules
enable "Modal Frame Register"
Go to admin/build/blocks
Place the 'Modal Frame Register/Login' block somewhere in your regions
Developed with Modal Frame API:
; Information added by drupal.org packaging script on 2010-05-14
version = "6.x-1.7"
core = "6.x"
project = "modalframe"
datestamp = "1273809616"
Thanks All!
Joe Hyde
http://www.hydeinteractive.com/
| Comment | File | Size | Author |
|---|---|---|---|
| modalframe_register.tar_.gz | 2.86 KB | jghyde |
Comments
Comment #1
webavant commentedThis module works great and I hope it is committed very soon!
Comment #2
bratsun commentedsuper cool! exactly what i was looking for! thanks.
Comment #3
bratsun commentedTo my mind it has only one drawback now. When you close the modal window, the page gets refreshed. What if the visitor did not fill in anything (just decided to login later)?
Comment #4
btopro commentedAs some simple "fixes" to better conform with drupal convention. references to $_GET['q'] should be arg()
if ($_GET['q'] == 'modal/register' || $_GET['q'] == 'modal/login' || $_GET['q'] == 'modal/register/welcome') {
should be more like
if (arg(0) == 'modal' && (arg(1) == 'register' || arg(1) == 'login')) {
Other then that this looks great, going to try it out now. +1 for adding this in.
Comment #5
btopro commentedupon form submission (logging in) it reloads the logged in session inside the ModalFrame... lookin at how to fix it now..
Comment #6
jonfhancock commentedSubscribing
Comment #7
markus_petrux commentedI have fixed a few coding standard issues and reorganized a little the code so that all functions are prefixed with module name, etc.
Committed to CVS:
http://drupal.org/cvs?commit=394174
http://drupal.org/cvs?commit=394176
Also, I have updated the README and the project page with a reference to the new module.
Thanks for the contribution. I'm sure it will help many sites out there as a base to their own customized implementations.
Comment #8
jghyde commentedAfter login, it stays on the same page by design. But how do you show that the user is logged in unless you reload the page to show the "logged in" version of the log-in block?
The refresh is fired by JQuery, so I guess you could edit that, or make a admin option to not reload the page (and hence load a diff Jquery function)
Joe
Comment #9
jghyde commentedAWESOME! My first module is committed! Time to crack out the beer.
joe
Comment #10
jghyde commentedI tested #5. It does load the destination in the modal frame after login IF the login_destination module is enabled.
I am not sure to call this a bug or call it "by design" and suggest that the module will forever be incompatible with login_destination.
Here's why:
The module prints login links from a block. The block login stays on the same page. That's why the module was written: To provide a way to log in without leaving the page that you are on.
So, if a page loads inside the modal window after clicking the submit button on the login modal, check and see if you also have login_destination enabled. Disable login_destination and see if the problem persists.
I'd appreciate feedback on fixing compatibilty with login_destination AND if there are any other conflicts that cause the modal window to contain the resulting page, full headers and all.
Thanks!
Joe
Comment #11
markus_petrux commentedSince the module has already been committed to CVS, I think it is now better to deal with any outstanding issues using separate posts in the queue.
Please, post patches using the proper format and follow Drupal conding standards. :)