Closed (duplicate)
Project:
Facebook Connect
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Apr 2010 at 02:47 UTC
Updated:
1 Oct 2011 at 07:45 UTC
Hi could you please add a block that only has fbconnect button? Or even just a standalone form that can be called from code?
I tried doing this myself, but something about the javascript that should run on the page (I think) means that it didn't work.
As a work around hack, I've form_altered the user login block to hide the user/pass stuff. Pasting here for others:
function MYMODULE_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'user_login_block') {
if ($_GET['destination'] != 'fbconnect') { // Line copied from fbconnect module, not sure of significance.
$form['pass']['#type'] = 'hidden';
$form['name']['#type'] = 'hidden';
unset($form['links']);
$form['submit']['#type'] = 'hidden';
}
}
}
Comments
Comment #1
mbeach1 commentedThere's a way to do it, but its kindof an ugly workaround.
From your site, logged out, view page source and look for something like the following:
<fb:login-button size="medium" length="short" onlogin="facebook_onlogin_ready();" background="dark" v="2">Login using Facebook</fb:login-button>Copy that code and insert it into a block. Make sure you are using an input method that is not filtered.
If you change any of the button settings through site configuration, that code will change but you will have to update your block manually.
Comment #2
simeThanks mbeach1, great to know :)
Comment #3
vectoroc commentedPerhaps you can use fbconnect_render_button() instead
Comment #4
simeMy first attempt was to use this in a form called from some custom block code. It didn't work for me it and I sensed that some events/click handlers weren't properly attached. I didn't understand what was going on enough to debug it.
Comment #5
venusrising commentedThe problem is if you paste the code an in a block and then click a login link the block turns into
Does anyone know why this happen when the regular Drupal login link is clicked?
Comment #6
venusrising commentedComment #7
core44 commentedId really like to achieve this too, did anyone manage to get this working properly?
Comment #8
giorgio79 commentedBeen looking for this just now, would be a great feature. Looking to turn off the regular Drupal user login block and just have FB Connect.
Comment #9
giorgio79 commented#1296370: Code Cleanup and Fixes