We're catching the login form in lightbox2, so that it appears in a pop-up window. With Facebook connect, the text for the link "Sign in using Facebook" appears in the login form, but it's not a clickable link. just text.

going to user/login, however, we get the facebook connect button and everything functions as expected.

any ideas?

Comments

mariano.barcia’s picture

subscribing. This works for me:

/**
 * Render a custom button to log in via Facebook.
 */
function fbconnect_render_button($size = 'medium', $length = 'short') {
  /* 
  return '<fb:login-button onlogin="facebook_onlogin_ready();" size="'. $size .'" background="dark" length="'.$length.'">
          </fb:login-button>';
  */
  // Replace FBML with regular HTML, per indications at http://wiki.developers.facebook.com/index.php/Fb:login-button
  $output = '<a href="#" onclick="FB.Connect.requireSession(); return false;" >' .  
            '<img id="fb_login_image" src="http://static.ak.fbcdn.net/images/fbconnect/login-buttons/connect_light_' . $size . '_' . $length . '.gif" alt="Connect"/> '. 
            '</a>';
  return $output;
}
mariano.barcia’s picture

Hmm, sorry, it shows the link but the onClick event is not working...

friolator’s picture

Has anyone been able to get this working?

itaine’s picture

I second this. Has anyone found a work around?

friolator’s picture

we are able to get the button to appear using the code above, but like mariano.barcia, it's unclickable.

I know almost nothing about javascript, though I'm proficient in PHP. I really don't know how or where to go about trying to debug this. any help would be most appreciated. As it is, we're forced to ditch lightbox for login, at least until this works.

thanks!

friolator’s picture

I think we got this working today. Still testing, but it seems that the problem is easily solved by adding the $closure theme variable at the end of page-node-lightbox2.tpl.php

Once we did this, the button started responding. I am assuming mariano.barcia's notes above still apply since we haven't removed that tweak and the button is now doing something from the lightbox login window.

mariano.barcia’s picture

Great! Looking forward to the final fix.

obiwankaynobi’s picture

subscribing :)

Garry Egan’s picture

We're dying here over this one. Anyone got an idea on how to fix lightbox login with the facebook connect module? It's got a show stopper bug in it.

vectoroc’s picture

I think that lightbox2 does not call Drupal.attachBehaviors
So you could call it manually or call FB.XFBML.parse() or see http://drupal.org/node/365584#comment-3539890

jtsnow’s picture

vectoroc is correct. The following code is a quick fix. You can also override the function in your theme if you don't want to patch fbconnect.module.

<?php
function theme_fbconnect_login_button($text, $attr) {
  $content = '<fb:login-button ' . drupal_attributes($attr) . '>' . $text . '</fb:login-button>';
  $content .= '<script>FB.XFBML.parse()</script>';
}
?>
webfunkin’s picture

This seems to work pretty well. Thanks. Will let you know if I come across any errors

lildragon’s picture

thanks @jtsnow, the quick fix works!!! been searching for days.