In order to provide a visually consistent way to indicate that your site is using Google Friend Connect, we offer several options for generating buttons which include handling both joining or signing into a Friend Connect site. These options are:
It is also possible to apply CSS styling to the text in either a rendered Friend Connect button or link.
Usage
Before stepping into usage examples, here is the Friend Connect JS API method explanation along with parameter descriptions.
| Method | Description |
|---|---|
google.friendconnect.renderSignInButton(params) |
Renders either a 'sign-in' or 'join' button branded with Google Friend Connect.
The argument params is an object that accepts the following inputs:
|
The branded button with gray elements renders a Google Friend Connect button with a branded Google icon on the left and text in the center of the button. A small gray message "with Google Friend Connect" is also rendered below the button. The default text is "Sign in"
Usage Example:
<script type="text/javascript">
...
function renderButton(){
google.friendconnect.renderSignInButton({ 'id': 'gfc-button' });
};
</script>
...
<div id="gfc-button"></div>
The preceding code will render the following button:
The standalone button Friend Connect button is almost identical to the branded button, except it does not have the gray text 'with Google Friend Connect' underneath the button. The standalone option is available by rendering the button with style parameter defined as long.
Usage Example:
<script type="text/javascript">
...
function renderButton(){
google.friendconnect.renderSignInButton({ 'id': 'gfc-button', 'style': 'long' });
};
</script>
...
<div id="gfc-button"></div>
The preceding code will render the following button:
This rendering option does not render a button at all. Instead it renders a Google Favicon icon along with some text which can either be specified or left as default.
Usage Example:
<script type="text/javascript">
...
function renderButton(){
google.friendconnect.renderSignInButton({ 'id': 'gfc-button', 'style': 'text' });
};
</script>
...
<div id="gfc-button"></div>
The preceding code will render the following favicon image and link:
It is also possible to add CSS styling to Friend Connect link text. This is doable by assigning a style for the button text of a target div that you are rendering into.
In the case of a rendered link, you would apply a style in the form of: #<button container div> a {style(s)}. The a argument specifies that the link inside of the div is where the style is being applied.
Usage Example:
<script type="text/javascript">
#gfc-button a {font-size: 20px; font-family: courier; }
</script>
...
<script type="text/javascript">
...
function renderButton(){
google.friendconnect.renderSignInButton({ 'id': 'gfc-button', 'style': 'text' });
};
</script>
...
<div id="gfc-button"></div>
The preceding code will render the following Friend Connect link with styling applied:
Further button examples can be found on the GFC button rendering examples page.