You are not logged in.   Log in | Register

Socialize Module for Drupal

From $1

 

Introduction

Gigya Socialize Module for Drupal provides a single API that aggregates authentication and social APIs from Facebook Connect, MySpace ID, Twitter, Yahoo, LinkedIn and OpenID providers including Google, AOL and WordPress. The Gigya module for Drupal is fully configurable, requiring little time to install.

Gigya’s Socialize Module for Drupal makes it easy for Drupal site owners to:

  1. Authenticate users via Facebook, MySpace, Twitter and other OpenID providers, thereby increasing site registration rate by over 30%.
  2. Increase user acquisition by enabling users to invite friends to the site, or to share site content or a specific event.
  3. Increase site traffic by sending user status updates, tweets and newsfeed events to social networks. Drupal site owners can couple user actions on the site with sending social network status updates, tweets, and publishing newsfeed items.
  4. Customize the user experience by making it easy for sites to integrate user profile and social graph data
  5. Easily configure user experience, design, and module functionality using the Drupal administration panel.

 

We invite you to watch our webinar, which provides a walkthrough of the Gigya Socialize Module and tips for implementing it on your Drupal site.

 

Installing the Gigya Socialize Module

Installing the Gigya Socialize module requires a bit more than downloading and enabling the module. Please follow the Gigya Module installation steps:

  1. Download the module here and install, following to the usual module installation process.
     
  2. Create an account in Gigya's website.
     
  3. Configure your site details in the Site setup section of the Gigya website. The Socialize Setup wiki page provides detailed instructions and steps for setting up your site, as well as specific directions for setting up applications in Facebook, MySpace, Twitter, Yahoo and LinkedIn. Administrators can either setup applications on the social networks or have Gigya provide these applications for your site. 
  4. Copy the Gigya API Key and the Secret Key from Gigya's Site setup page:

    SiteSetup_Keys.png 

    On your Drupal site, go to Administer->Site Configuration->Gigya and paste the Gigya API Key and the Secret Key in the corresponding text fields at the top of the page:

    Drupal_ConfiguringKeys.gif 

     

Note: Please make sure you have installed the preliminary required modules, which are defined in the Dependencies section on the Gigya Socialize Module page on drupal.org

 

Configuring the Gigya Socialize Module

To configure the Gigya Socialize Module, login as Site Administrator and then go to Administer->Site Configuration->Gigya. Your configuration options are:

 

Networks available to socialize

Select the social networks that you wish to make available for user authentication:

Drupal_ConfNetworks.gif
 

Your selection will affect the user interface of the Gigya Login Widget, which will now display the icons of the selected social networks:

Drupal_Login.gif

 

Parameters for Login UIConfig

In this section you may configure the user interface of the Login block area.

Drupal_LoginBlock.png
 

Login configuration options are:

 

Suppress Drupal login

If you check the following checkbox, your Login block area will include only Gigya's Login widget and exclude Drupal's standard login.

Drupal_ConfLogin-SuppressDrupal.png        Drupal_ConfLogin-SuppressDrupal2.png

 

Note: Adding "/user" to your site's URL points to a page that includes the standard Drupal login. If you disable the standard Drupal login, the site administrator will be able to log in via the "/user" page.

 

Enable Linking of social networks accounts

Checking the following checkbox, will enable users to login with their Social Network credentials and map those to their existing Drupal account.

Drupal_ConfLogin-Linking.png

 

A new section will appear at the bottom of the registration from (see screen shot below), that allows the user to link his existing Drupal account to the Social Network credentials he logged in with:

Drupal_ConfLogin-Linking2.png 

 

Public Registrations Settings

This section is an extension and refinement of Drupal's standard "User" settings->"Public Registration" section. We have introduced a new option: whether or not to allow users to create regular Drupal accounts outside Socialize.

Drupal_ConfLogin-PublicRegistration.png

 

The first option, which is a new option that is not offered by the standard Drupal "User" settings, means that users can create new accounts only via Socialize registration. This option should be used in conjunction with checking the "Suppress Drupal login" checkbox above.

The second and third options allow users to create Drupal accounts directly, without using Socialize. This is possible only if the "Suppress Drupal login" checkbox above is not checked.

 

Widget Design

This following configuration section provides several parameters for configuring the look-and-feel of the Gigya Socialize Login Widget. You can specify captions, sizes and colors:

Drupal_ConfLogin-Look-n-Feel.png       Drupal_ConfLogin-Look-n-Feel2.png

 

Advanced Settings

The following section provides some options for advanced UI configuration:

Drupal_ConfLogin-Advanced.png
 

URL redirect after login

This field provides the option of specifying the URL to which users will be redirected after they log in. The default setting redirects the user to the "user" page. The URL you enter in this field should be relative to your site URL and should not contain an initial or final slash. Please do not enter the entire URL. For example, let's assume your site's URL is "www.yoursite.com" and you enter "node/add" in this field. In this case, your users will be redirected to "www.yoursite.com/node/add" after logging in.

Custom Login Icons URL

This field lets you replace the icons of the social network buttons on the Login UI.

 

Drupal_ConfLogin-CustomIcons2.png         Drupal_ConfLogin-CustomIcons.png 

 

To replace the icons, first create a resource library SWF file which contains your custom icons (for guidance, please consult the Create a SWF file which contains your custom icons section), then enter the URL of your SWF file in this field.

LoginUI container ID

In this field, you can define an alternative container in which the Gigya Login Widget will be displayed. By default, the Widget is placed in divConnect, which is Drupal's standard Login block area.

 

Login UIConfig Advanced coding

The Gigya website features a Login Widget Setup Wizard. This Setup Wizard allows you to modify some settings, while previewing the changes as you make them. The Wizard then generates code which is based on your modifications. You may grab the generated code and paste it into the "Login UIConfig Advanced coding" textbox. The settings which the code in this textbox provides override the corresponding Login UI settings that are defined in this page.

Gigya's Login Widget Setup Wizard:

LoginSetupWizard.png

 

Drupal_ConfLogin-AdvancedCoding.png

 

 

Parameters for editConnections UIConfig

The Gigya Socialize Edit Connections Widget enables ones to establish connections to additional social networks and disconnect existing connections. In addition to being able to login using a specific social network,  users can connect to additional social networks so they can send status updates, share with friends, etc. on multiple social networks. This also applies to regular Drupal logged in users. So, users who logged in using the standard Drupal login can now connect to one or more social networks and see their friends, send status updates, etc.

The Gigya Socialize Edit Connections Widget appears in My Account -> Edit -> Social Networks:

Drupal_editConnections.png

The Widget displays user information from each social network to which the user is connected. It also provides a disconnect option and enables the user to connect to all the social networks to which she is not connected.

The configuration section provides several parameters for configuring the look-and-feel of the Gigya Socialize Edit Connections Widget.

 

Required services for socialize connect

Drupal_ConfConnections-Capabilities.png 

In this section you can determine which social networks will be available for the user to connect to, using the Edit Connections Widget.

Each of the checkboxes represents a Social Network capability. Not all the Social Networks possess the entire list of capabilities. The following list specifies the capabilities of the currently supported providers:

  • login - supported by all the Social Networks.
  • notifications - currently supported only by Facebook.
  • friends - currently supported by Facebook, MySpace, Twitter and Yahoo.
  • status - currently supported by Facebook, MySpace, Twitter and Yahoo.
  • newsfeed - currently supported by Facebook and Yahoo.

For example, if you check the "newsfeed" checkbox, your Edit Connections Widget will include only social networks which support newsfeeds. Currently this means that your Edit Connections Widget will include only Facebook and Yahoo buttons. In the future, however, if more social networks support newsfeeds they will automatically appear in the Edit Connections Widget.

 

Design customization

You may specify caption, sizes and colors for the Edit Connections Widget. This is done in a similar manner as for the Login Widget.

 

Advanced Settings

The following section provides some advanced UI configuration settings:

editConnectionsUI container ID

In this field you may define an alternative container in which you want to display the Gigya Friend Selection Widget.

editConnectionsUI UIConfig Advanced coding

This textbox is for advanced UI customizations. It employs Gigya's UIConfig parameter, which is an XML string that provides detailed control over the look-and-feel of the Widget. The settings provided by the code in this textbox override the Edit Connections UI settings above.

 

Gigya user profile picture

Checking the following check-box allows users to connect their social network profile picture to their Drupal profile picture:

Drupal_ConfPicture.png

 

Gigya <=> Drupal Profile Mappings

This section enables one to configure the mapping between user information fields that Gigya provides (by pulling from social networks) and profile fields in the Drupal website. The mapping configuration is used in the user registration - the registration form will be pre-populated with data pulled from the user's social network.

This configuration section includes the list of profile fields defined in your Drupal website. Each profile field includes a dropdown with fields that Gigya can provide. The list of fields that Gigya can provide depends on which social network the user is connected to and what information he has provided on that network.

Drupal_ConfMapping.png

 

Facebook Fields Population

When a new user registers to your site using his Facebook account, the registration form may be pre-populated will data pulled from the user's Facebook profile.

If you wish to activate the form pre-population, please check the following check box:

Drupal_ConfPopulation.png

 

Socialize Actions and Triggers

The option of using Actions and Triggers constitutes a significant part of the customizable abilities which the Gigya Socialize Module features.

The Gigya Socialize Module provides a Drupal advanced action:  "Share UI of Gigya Socialize".

This action needs to be created and configured first before it may be used.

Once you have configured the Gigya Module Actions, the next step is to proceed to the Triggers Module page and assign these actions to system events.

 

This section explains how to create and configure the Gigya Socialize Action, and provides a walkthrough example.

 

The "Share UI of Gigya Socialize" action

This action pops Gigya's Share widget:

ShareUI-withComments2.gif

The Share Widget is a pop-up dialog, allowing the user to post his action to social networks. The user is given an option to choose which social networks he want to post the content to, edit his personal message, and get a sneak preview of the feed item.

When the user presses the "Share" button, Gigya will publish the feed item to each of the social networks which the user selected (on the left hand side of the widget). During the publishing process, the Share widget will prompt 'connect' dialogs aiming to connect the user to the destinations he chose and to which he is not yet connected.

 

The configuration options for this Action are:

  • Edit the Description text, so as to make this action easily identifiable.
  • Edit the Default User Message text. This text will appear in the "User Message" text-box at the top of the Share widget. The user may edit the suggested default text.

 

Walkthrough Example

In this example, we would like to pop the "Share" widget each time a user comments on a Story. 

Step 1: Create a new "Share UI of Gigya Socialize" Action. 

Step 2: Configure the Action:

  • Edit the Description text: we have concatenated "for Comment" to the default text (as shown in the screenshot below).
  • In the Default User Message field, type the text: "!user posted a new comment".

Drupal_ActionShare.png 

  • Hit the "Save" button.

 

Step 3: Assign Action to Trigger

  • Proceed to the Comments Triggers page:  Administer->Site Building->Triggers->Comments.
  • Find the relevant Trigger: "After saving a new comment".
  • Select the relevant Action: "Share UI of Gigya Socialize for Comment".
  • Press the "Assign" button.

Drupal_ActionShare-Assign.png 

 

That's it! From now on, each time a user comments on a Story, he will be presented with the Share widget, which will give him the option to post his comment to various Social Networks.

 

In the following example, a user named "Assafeleven Esh" posted a comment on a Story named "Sunday Story":

Drupal_ActionShare4.png

 

After pressing the "Share" button, the following item will appear on the Facebook News Feed stream of the user and of his friends:

Drupal_ActionShare5.png

 

 

 

Advanced: Adding a media item to published user actions

You can add a media item (image/video) to the News Feed items that are published automatically through the "Share UI of Gigya Socialize" action. This involves editing the Gigya Module code.

Here is an example of a published action that includes a video:

UserAction-VideoPrev.gif

 

To add a media item to published actions, please follow these instructions:

  1. Go to the Gigya Module archive that you have downloaded and installed, and search for "gigya.module" file.
  2. Open the file in an editor.
  3. Search for function gigya_shareUI_mediaItem_js()
  4. Add the following code to the beginning of the method, right after the first line of code (instead of the commented code):
    • For Image:
      $mediaItem_js  .= ' mediaItemType="image"; ';
      $mediaItem_js  .= ' mediaItemSrc="INSERT-HERE-YOUR-IMAGE-URL"; ' ;
      $mediaItem_js  .= ' mediaItemHref="INSERT-HERE-URL-OF-A-LINK-TO-ASSOCIATE-WITH-THE-IMAGE"; ' ;
      

      For example:
      $mediaItem_js .= ' mediaItemType="image"; ';
      $mediaItem_js .= ' mediaItemSrc="http://www.marketresearchbulletin.com/wp-content/uploads/2009/09/mickey_mouse.jpg"; ' ;
      $mediaItem_js .= ' mediaItemHref="http://disney.go.com/mickeymouse/video2.html"; ' ;
      

    • For Video:
      $mediaItem_js  .= ' mediaItemType="flash"; ';
      $mediaItem_js  .= ' mediaItemSrc="INSERT-HERE-YOUR-VIDEO-URL"; ';
      $mediaItem_js  .= ' mediaItemPreviewUrl="INSERT-HERE-A-PREVIEW-IMAGE-URL"; ';
      
      

      For example:
      $mediaItem_js .= ' mediaItemType="flash"; ';
      $mediaItem_js .= ' mediaItemSrc="http://www.youtube.com/v/fzzjgBAaWZw&hl=en&fs=1"; ';
      $mediaItem_js .= ' mediaItemPreviewUrl="http://graphics8.nytimes.com/images/2006/01/02/science/03cute.large2.jpg"; ';

     

    The complete method should look similar to that:

    function gigya_shareUI_mediaItem_js() {
    
        $mediaItem_js = '';
    
    
        // The code you enter comes here:
        //----------------------------------------------------------------------------------------------------------------
    
        $mediaItem_js  .= ' mediaItemType="image"; ';
        $mediaItem_js  .= ' mediaItemSrc="http://www.marketresearchbulletin.com/wp-content/uploads/2009/09/mickey_mouse.jpg"; ' ; 
        $mediaItem_js  .= ' mediaItemHref="http://disney.go.com/mickeymouse/video2.html"; ' ;  
    
        //-----------------------------------------------------------------------------------------------------------------
    
    
        $mediaItem_js .= ' if (typeof(mediaItemType)!="undefined") { ';
        $mediaItem_js .= '   if  ( null!=mediaItemType && ""!=mediaItemType ) { ';
       $mediaItem_js .= '     if ( mediaItemType=="image" ) { ';
       $mediaItem_js .= '       if (typeof(mediaItemSrc)!="undefined" && typeof(mediaItemHref)!="undefined" ){  ';
       $mediaItem_js .= '         if (null!=mediaItemSrc && ""!=mediaItemSrc && null!=mediaItemHref && ""!=mediaItemHref ) { ';
       $mediaItem_js .= '            var mediaItem = { ';    $mediaItem_js .= '              src: window.mediaItemSrc, ';
       $mediaItem_js .= '              href: window.mediaItemHref, ';
       $mediaItem_js .= '              type: window.mediaItemType ';
       $mediaItem_js .= '            }; ';
       $mediaItem_js .= '            act.addMediaItem(mediaItem);';
       $mediaItem_js .= '         } ';
        $mediaItem_js .= '       } ';
       $mediaItem_js .= '     } '; 
       $mediaItem_js .= '     else { ';/* video */ 
       $mediaItem_js .= '       if (typeof(mediaItemSrc)!="undefined" && typeof(mediaItemPreviewUrl)!="undefined" 
                                               && typeof(mediaItemTitle)!="undefined" && typeof(mediaItemHref)!="undefined"){  ';
       $mediaItem_js .= '         if (null!=mediaItemSrc && ""!=mediaItemSrc && null!=mediaItemPreviewUrl && ""!=mediaItemPreviewUrl 
                                                  && null!=mediaItemHref && ""!=mediaItemHref && null!=mediaItemTitle && ""!=mediaItemTitle) { ';
        $mediaItem_js .= '            var mediaItem = { ';
       $mediaItem_js .= '              src: window.mediaItemSrc, ';
       $mediaItem_js .= '              href: window.mediaItemHref, ';
       $mediaItem_js .= '              title: window.mediaItemTitle, ';
       $mediaItem_js .= '              previewImageURL: window.mediaItemPreviewUrl, ';
       $mediaItem_js .= '              type: window.mediaItemType ';
       $mediaItem_js .= '            }; ';
       $mediaItem_js .= '            act.addMediaItem(mediaItem);';
       $mediaItem_js .= '         } ';
       $mediaItem_js .= '       } ';
       $mediaItem_js .= '     } ';
       $mediaItem_js .= '   } ';
       $mediaItem_js .= ' } ';
    
    return $mediaItem_js;
    
    }
    
Tags:
Files (0)