Closed (fixed)
Project:
Facebook Connect
Version:
7.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Nov 2010 at 09:47 UTC
Updated:
3 Jul 2020 at 14:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
heyyo commented+1
Comment #2
geekgirlweb commented+1
Comment #3
angelmax commented+1
Comment #4
ArnaudDrupal commented+1
Comment #5
YK85 commented+1 subscribing
Comment #6
earthday47Until this gets in the module, there's a way to add it manually. If you look ~ Line 200 of fbconnect.module, you'll see this form alter:
fbconnect_render_button() function calls the THEME function fbconnect_login_button().
So you could add it yourself using hook_form_alter(). If you wanted to add it to the user/register form, you would create your own module called mymodule, and declare a function called mymodule_form_alter() that looks like this:
The
module_exists('fbconnect')call ensures that the FB Connect module is enabled, preventing errors and warnings.The
'#weight' => -50adds the button at the very top of the form. If you want it at the bottom, make weight 50 (positive).I'm using this in my module and it works great.
If you're not form altering, and you want to display the button, just add
$form = array();just after
if (module_exists('fbconnect')) {, and then at the bottom call:drupal_render($form);This will convert the form array to HTML. Then you have a fully formatted Facebook Connect button ready to output!
Comment #7
YK85 commentedThanks for the great info!
Would you be able to create a patch that adds this to the module?
Then it could be reviewed by a larger audience and possibly be committed?
Your help would be really appreciated!
Thank you
Comment #8
earthday47Sure, I'm just not good at patching things.
I'll try to wrap it in a module for the short-term, and then add a configuration checkbox to enable/disable this feature.
Comment #9
earthday47Here's a completely untested patch.
I added two new variables, fbconnect_user_reg_display and fbconnect_user_reg_location, on the "Appearance" tab of the FBConnect module, and shows the FBConnect button on the user/register page. The second variable is if the button is on the top or the bottom of the form.
Comment #10
earthday47changing status
Comment #11
wizonesolutionsThanks #982918-6: Add login with facebook in register form! I did the same thing myself in a custom module, but missed the $attr setting and who knew, it was actually pretty important.
Comment #12
theatereleven commentedI'm looking at this stuff, but it is a little over my head. We have a custom registration page, so I have to manually print stuff on the pages. Not sure how to get this module to appear anywhere in my custom theme once enabled and configured on the back end.
Using a custom Zen based theme on Drupal 6.x / Project Mercury.
Comment #13
balajimca commentedi want step by step installation of fbconnect mudule and creating login with facebook option in drupal site. Anyone can help me pls. I'm using drupal 7.7. fbconnect module displaying API settings screen only, not displaying login screen in my drupal 7.7 project. I've attached my fbconnect module.
Comment #14
beautifulmindHere is the improved and ported code for 7.x as provided in comment #6
In addtion, you have to make sure that, you uncheck the box shown in red in the image attached here.
Regards.
Comment #15
jcisio commentedA slightly modified patch from #8 is committed.
Comment #17
venusrising commentedWhat about Drupal 6. Can someone kindly share the modified code that may work.
Comment #18
jsidigital commentedI tried code on comment #14 by "beautifulmind".
Works great!
Any idea how to create a block using this custom module?
Facebook Connect already comes with a block, but its not editable and i want to be able to add text above the button.
So using the custom module in comment #14, anyone know how this can be made into a custom block?
Thanx.
Comment #19
beautifulmind@jsidigital You can try with block creating api hooks and the put the code it it. If you need help, let me know.
Regards.
Comment #20
beautifulmindI have this working on http://drupaldeveloper.in/user/login
You can take a look at the code here: http://drupaldeveloper.in/codelet/drupal-login-register-facebook-connect...
Please make sure you have all the dependent modules enabled.
Regards.