views:

113

answers:

1

I was wondering if it's possible to have multiple log in buttons for Google Friend Connect...

google.friendconnect.renderSignInButton({id:"google-login",style:'long'})

That code renders the log in button. Unfortunately it accepts an id, and id's have to be unique.

Is there any way to do something similar to

google.friendconnect.renderSignInButton({class:"google-login",style:'long'})

that would make all the divs with class="google-login" render as a log in button? Or even just to render two separate log in buttons:

google.friendconnect.renderSignInButton({id:"google-login1",style:'long'})
google.friendconnect.renderSignInButton({id:"google-login2",style:'long'})

Anyone know of a solution?

+1  A: 

Yes it is possible. Remember that when passing the id to renderSignInButton you are not setting the new button id but it's the id of a container where this new button should be placed. I also noticed that you cannot have two sign in buttons in the same container (at least without cloning them manually).

I found this demo page and run following commands using Firebug's console

google.friendconnect.renderSignInButton({id: 'memberstate', style: 'long'});
google.friendconnect.renderSignInButton({id: 'colorPicker', style: 'standard'});
google.friendconnect.renderSignInButton({id: 'profile', style: 'text'});

As you can see this will create three sign in buttons, each in different style

RaYell