The problem is in line 549 on my system - it fails validation with attribute errors:

<div class="item-list"><ul><li class="first last"><fb:login-button onlogin="facebook_onlogin_ready();" size="medium" background="white" length="long">

No biggie, but you may as well fix it for future releases. Looking forward to using this as soon as the Google Maps conflict gets ironed out!

Comments

pvhee’s picture

The validation error is still here. W3C's validation service returns with

there is no attribute "onlogin".
…first last"><fb:login-button onlogin="facebook_onlogin_ready();" size="medium

Is there any way to get rid of the errors? (you cannot get rid of the fb:login-button obviously) Do you maybe need to use a new doctype so that facebook tags validate?

pvhee’s picture

Version: 6.x-1.0-beta4 » 6.x-1.0-beta7
budda’s picture

According to http://wiki.developers.facebook.com/index.php/Fb:login-button the button can be implemented using standard html and javascript to avoid the W3C validation. Weirdly, i thought the additional namespace in the page.tpl.php sorted out the FBML tags and attributes?

tsi’s picture

Version: 6.x-1.0-beta7 » 6.x-1.0-beta9

Subscribing

gregarios’s picture

Title: FBC Causes W3C XHTML Validation To Fail » FBC causes page validation to fail

I tried replacing the appropriate code in this module with the html method found here:
http://wiki.developers.facebook.com/index.php/Fb:login-button

...and it worked AND validates W3C.

There would have to be some small changes to the variables that feed the button, but this is doable.

You don't even need to use the CSS file they recommend in the instructions. It just works.

UPDATE: It worked in Safari, but not Firefox. Haven't tested in IE.

gregarios’s picture

Title: FBC causes page validation to fail » FBC Causes W3C XHTML Validation To Fail
vectoroc’s picture

Title: FBC causes page validation to fail » FBC Causes W3C XHTML Validation To Fail
Priority: Normal » Minor
vectoroc’s picture

Status: Active » Needs review

update here

if you want to use only connect function (login button), you can place next code in your theme/module. It will replace fbml login button with standard-compliant html button

function phptemplate_fbconnect_login_button($text, $attr) {
  $size_class = 'fb_button_'. $attr['size'];
  
  $a_attr = array(
    'href' => '#',
    'class' => $size_class,
  );
  
  $div_attr = array(
    'id' => 'login',
    'class' => "fb_button $size_class $attr[class]",
  );
  
  if (isset($attr['onlogin'])) {
    $a_attr['onclick'] = "FB.login(function() { $attr[onlogin]) }); return false;";
  }
  
  if (isset($attr['onclick'])) {
    $a_attr['onclick'] = $attr['onclick'];
  }

  if (!isset($a_attr['onclick'])) {
    $a_attr['onclick'] = "FB.login(facebook_onlogin_ready); return false;";
  }
  
  $a_attr = drupal_attributes($a_attr);
  $div_attr = drupal_attributes($div_attr);
  
  return <<<HTML
    <div $div_attr>
      <a $a_attr>
        <span class="fb_button_text">
          $text
        </span>
      </a>
    </div>  
HTML;
}
pingwin4eg’s picture

Unexpected token )

-    $a_attr['onclick'] = "FB.login(function() { $attr[onlogin]) }); return false;";
+    $a_attr['onclick'] = "FB.login(function() { $attr[onlogin] }); return false;";
pingwin4eg’s picture

One more thing: "perms='email'" doesn't render here. So we can't get user's FB email when autoregistering him/her. Is there some solution for it?

guruslot’s picture

Hi,

Is it possible to have a couple of words on where to put the code written above?

Thanks!