I read the README.txt from start to finish. (and i have a good grasp on it) Love the module set.

I see that there is a block for editing the facebook login button. However I would like to control the attributes of the facebook button that is being displayed by hook_form_alter on the /user and /user/register pages.

I am not asking about the text. I would like to add the size="x-large" and width="400px" attributes. Is there a way to add the code from the provided block to the user-register.tpl?

In my template.php I added

function acquia_prosper_fb_connect_block_login_defaults() {
  return array('anon_not_connected' => array(
                 'title' => t('Facebook Connect'),
                 'body' => '<fb:login-button size="x-large" perms="!perms" v="2"></fb:login-button>',
               ),
               'user_not_connected' => array(
                 'title' => t('Facebook Connect'),
                 'body' => '<fb:login-button size="x-large" perms="!perms" v="2"></fb:login-button>',
               ),
               'connected' => array(
                 'title' => t('Facebook Connect'),
                 // Logout commented out, because drupal has logout link.
                 'body' => "<fb:profile-pic uid=!fbu></fb:profile-pic><!--<fb:login-button autologoutlink=true></fb:login-button>-->",
               ),
  );
}

But it still did not affect the user and user/registration pages.

Thanks for any help in advance.

Comments

sistro’s picture

subscribing

Dave Cohen’s picture

Issue tags: +fb-volunteer

I invite you to submit a patch that makes the markup customizable.

The workaround for now is to do the form_alter in your own custom module and tweak the markup to your hearts content.

bradallenfisher’s picture

Hi Dave,

Thanks for the reply. On the user management admin page there are check-boxes that allow the module to alter the form. Do you know where the code is that alters the user and user/registration forms? If i could locate that i could give it a whirl. (to be clear... i am not looking for the admin code that creates the check-boxes on the user management page, rather the actual code that call the form_alter for the user page).

Again thanks for your help.

Dave Cohen’s picture

fb_user_form_alter(), in fb_user.module

bradallenfisher’s picture

Thanks Dave. Appreciate your help.

david.moore.ipg’s picture

Did anyone ever make a custom module for adding the Facebook connect button to a form or block other than login and registration? Is it a part of any of the contrib modules? In the Drupal Commons distro there is a "Join & learn" block on the home page and I would like to add the Facebook connect icon there (in addition to Login and Registration). I would like to do it with a custom module so I don't have to re-hack the code each time there is an upgrade.

Dave Cohen’s picture

I want to revise my earlier comments...

You could write a custom form alter as I suggested. OR, you could override theme('fb_login_button'). And overriding the theme function is probably the better way.

@david.moore.ipg, fb_connect.module includes a block designed to show a facebook connect button. It's easily configured. Once fb.module is installed, you could add any XFBML markup to any block, template or code.