When using the Shadowbox Login it is a nice modal implementation. However, new users to the site dont know immediately how to register. Perhaps to the block another link should be added for Registration? Maybe even create a modal form for user registration to use AJAX similar to the login implementation?

Comments

manfer’s picture

The shadowbox login modal is showing login block in a modal so it must have both a registration and a lost password links. If those are not showed for you maybe is your theme that has hooked that block. Or maybe you have disable registration for visitors.

Anyway I'm thinking into changing that modal to show the three forms inside the modal.

polskikrol’s picture

It shows in the modal, thats the issue. Think it would be better to show up in the block (which currently only has one link 'login'). Different modals can then be used for each option off the block?

manfer’s picture

Status: Needs review » Active
StatusFileSize
new6.22 KB

Try this patch please. Take in mind too that it is not only the shadowbox login block links the ones that trigger the login modal. You can add menu links to trigger those login modals. A menu entry which path is "user/login" will trigger the login modal. A menu entry which path is "user/register" will trigger the register form modal. A menu entry which path is "user/password" will trigger the new password request modal.

Indeed any link which href is "user/login", "user/register" or "user/password" will trigger the modal.

manfer’s picture

Status: Active » Needs review
polskikrol’s picture

Status: Active » Needs review

Will test this within the next 2 or 3 days.

manfer’s picture

StatusFileSize
new65 bytes
new11.95 KB

Better patch.

The binary file, gif image, "bg.gif" has to be placed in the folder "/sites/all/modules/shadowbox/login_shadowbox/css/"

polskikrol’s picture

Wow, that looks much better. Still testing, but one issue I see with Firefox is that the scroll bar doesnt fit in the modal. The top part of the scroll bar is aligned, but the bottom part goes off the screen, so if you drag down as far as the display lets you, cant see the rest of the form, including the submit buttons.

polskikrol’s picture

Also, found the following issues:
(1) Would be good to be able to set height and width for all 3 options, not just the login.
(2) Request new password doesnt open up in modal, take you directly to the node.
(3) When user logs in, keep the block visible but include now a link for "Logoff".

manfer’s picture

StatusFileSize
new16 KB
new65 bytes

(1) Would be good to be able to set height and width for all 3 options, not just the login.
Heights where already configurable, width was the same for all 3 forms. Added individual width configuration for each form.

(2) Request new password doesnt open up in modal, take you directly to the node.
I introduced a bug in previous patch. Solved with this new one.

(3) When user logs in, keep the block visible but include now a link for "Logoff".
Added a configuration option on the shadowbox login block.

About the scroll should not appear when the configured widths, heights are enough to contain the forms. When the window is scaled the dimension can be not enough but it is the user who should scale up the window to see the form. Well, really those forms are not too wide, nor too high to be greater than a normal viewport in any modern monitor.

manfer’s picture

StatusFileSize
new65 bytes
new16.09 KB

Reviewed CSS to try to solve the scrolling problem.

polskikrol’s picture

CSS problem appears to be resolved. Noticed a few other small items that should be corrected before merging this patch into dev:

(1) Missing the following div enclosure...

<div class="content">
<div class="item-list"> missing
<ul>
....
</ul>
</div> missing
</div>

(2) The modal windows have no way to escape them, unless you reload the page. Think there may be a way to shove an 'X' in the corner with modal so a user can close it.

polskikrol’s picture

One more item, maybe group the configuration options in the Login Shadowbox so that the height/width for each modal type are together and collapsible ;)

polskikrol’s picture

Spoke too soon, RECAPTCHA 7.x-1.7 breaks in the modal window :[

manfer’s picture

StatusFileSize
new65 bytes
new20.85 KB
polskikrol’s picture

That patch gave some issues applying it to vanilla 7.x-4.0-beta4. Shadowbox login appears broken afterward.

manfer’s picture

I have to read how to create the patches when there are new files, probably not the command I used or maybe the diff is not than against that 7.x-4-0.beta4.

Anyway still needs a little more tweak. I will include a new patch as soon as I have it finished.

manfer’s picture

Version: 7.x-4.0-beta4 » 7.x-4.x-dev
StatusFileSize
new26.15 KB

I change the issue version because patches are always against development version. Probably when this issue started both development and 7.x-4.0-beta4 where at same stage.

New Patch that I think works with recaptcha. Now it even shows the errors in the modal so the modal only closes when the forms are succesfully submitted.

manfer’s picture

The previous patch is incorrect. I attach a new one, already tested.

It is to be applyed to the development 7.x-4.x-dev version and includes the binary file so is the only thing that needs to be applyed.

git clone --branch 7.x-4.x http://git.drupal.org/project/shadowbox.git

cd shadowbox

//  Then  you  download  the  patch  and  place  it  in  this  shadowbox  folder  and  apply  it
git apply  -v shadowbox_login-additional_links-1488718-18.patch
polskikrol’s picture

Tested this and see the following issues:

(1) Marinelli 7.x-3.0-beta11 theme breaks. There is a rotating image banner which uses javascript. This stop working. Didnt see this issue with patch from post #10.
(2) RECAPTCHA 7.x-1.7 still broken. The text comes up stating that the user has to complete the captcha. However, the recaptcha doesnt load.

I can only think this is an issue with a hook where the javascript for the page is being invoked.

manfer’s picture

(1)
I suppose you mean that the shadowbox login does not look as good with Marinelli but I don't see shadowbox login breaking anything in Marinelli.

I can't do anything about the CSS not fiting every drupal theme but that's why the shadowbox login module has a configuration option to provide your own CSS. So anyone can customize it, even starting from the provided one if needed.

Besides the shadowbox login CSS file is loaded before any CSS of the theme layer so one can instead of providing own CSS in shadowbox login configuration, just overwrite any CSS rules to his needs in theme layer. In case of Marinelli that would be modifying the theme to add CSS rules for shadowbox login.

(2)
You must have enable the recaptcha option to "Use Ajax API". Without that option the recaptcha works correctly. This must be because I'm not adding all javascript on the pages loaded inside shadowbox login modal so I would need to review that in order to make recaptcha work with ajax api.

polskikrol’s picture

There is still a problem where the default banner (which uses JS) in Marinelli is broken on admin pages when the module is enabled now.

Will test (2) tonight.

polskikrol’s picture

Actually was able to test it without underlying filesystem access:

(1) AJAX API disabled, recapthca works. However, supporting the AJAX API would be needed I think (at least for stable release).
(2) Receive the following error on admin/* pages when clicking on

parent.Shadowbox is undefined
[Break On This Error]

if ( ! is_shadowbox_form && parent.Shadowbox.isOpen() ) {

JS fails to load for the Marinelli banner and all of the images are shown at once overlaid on top of the content, making administration impossible.

Hope this is detailed enough?

manfer’s picture

  • Solved javascript error on admin pages.
  • Tweaked CSS to try to make a theme independent Shadowbox Login Skin.
  • Recaptcha using AJAX API should work now.
polskikrol’s picture

Looks really good now. I just had to modify some of the CSS in the block that was missing to get the formatting of the bullets to work. Patch is attached. My first time working with git to create a patch, so hope it works!

Update: Think I missed something, I downloaded the branch, applied your patch, added some code, and 'git diff' produces smaller sized file. Something is not right.

manfer’s picture

I have drupalized the shadowbox login block content. This is the modified patch.

The problem to make this patch is that there is a new binary file (not text file), the gif graphic file. So to create the diff we need to instruct git about that:
git diff --binary

polskikrol’s picture

Looks like there is a small bug in this version. After logging in, the shadowbox login window remains open and the redirected page is loaded within the modal. Instead, modal should be closed and main page redirected, no?

manfer’s picture

Please, first clear any cache to be sure you are running new javascript files.

Check in console if there is any javascript error.

If you continue experimenting that problem then try another browser and report back with your result. Fails on all browsers or only a specific browser? I have tested several browsers and works fine for me that's why I wonder if this is a specific browser issue (ie maybe).

polskikrol’s picture

Checked that this issue does not creep up in Internet Explorer of FireFox. However, having the issue in Google Chrome. Apologies for not getting the exact error (if there is any), will check tonight. However, it appears to just load the whole refreshed page in the modal, instead of refreshing the whole page.

polskikrol’s picture

Did also notice the following error as well in dblog:

Page not found: sites/all/modules/shadowbox/login_shadowbox/images/buttons.png.

Not sure if this was added to the patch?

polskikrol’s picture

Ended up clearing all browser cache in Chrome and looks a little better. It still loads the page in the modal for second, but then refreshes the whole page and loads the page completely. The end result is what is expected, however, the modal loading the page and small lag is interesting. Still get the error for the missing buttons.png thought.

manfer’s picture

The buttons.png is a CSS mistake. There is a reference to an image file that is not available. I'm using CSS for buttons that I already had. No problem with that error. I already has it corrected some time ago in my local git folder.

And about the loading of the page in the modal is how it is intended to work. I can't think of doing it in a different way. The shadowbox modal is an iframe that loads the page with the form. When the user logins, it is detected -I tried to do it as soon as possible- and the modal is closed redirecting the parent page to the proper path. I don't know exactly why you see that more clearly in chrome than in other browsers but is working the same on all of them.

It would be better if I could do it in a different way but I can't think of other way. Anyway being an iframe gives the opportunity to get all the errors captured inside the modal and that looks great in my opinion.

But that lag you are seeing is just by design.

polskikrol’s picture

Fair enough, thank you for the explanation.

When you say "I already has it corrected some time ago in my local git folder.", I had used patch shadowbox_login-additional_links-1488718-25.patch after refreshing the git copy. Should I do this process again to ensure the css fix is included?

manfer’s picture

No, I would have to make another patch to include that. It is on a branch where I developed this feature. When this issue is finish I have to merge that branch with 7.x-4.x branch and push it. After that you can use the development version 7.x-4.x-dev without the need to apply patches.

Maybe is better if I do it already. Do you think it works as expected now?

polskikrol’s picture

Yes, I think you can definitely push this to 7.x-4.x-dev.

manfer’s picture

Title: [Shadowbox Login] Add additional link 'Register'? » [Shadowbox Login] Improved shadowbox login
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 6ac9e65 on 7.x-4.x, 8.x-1.x by manfer:
    Issue #1488718 by manfer: Improve shadowbox login.