[GSoC 2016: Social API] Week 2: Customizable block for user login

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
gvso's picture

Date of publication: 06/06/2016
Source: GVSO Blog

In the last weekly meeting with my mentors, we agreed to remove the hook that alter the user login. Instead, we decided to use blocks from the Social API parent modules since this is the most basic, flexible and extensible way to render things in the page. This is especially true if you want to provide integration points, and then render based on those on behalf of an unknown number of implementer modules.

Thus, this week on Google Summer of Code I was working to allow site builders implement user login through social network accounts and make this functionality available as a block. For example, the site builder could enable a Social Auth integration, like this version of simple_fb_connect, and customize a block in any region he wants. 

 

Social Auth integrations

 

Place block option

Approaching the issue

Here is the commit which approaches the issue we discussed with my mentors. Furthermore, this is the Social Auth Block definition.

Notice that the Social Auth Block gets the Immutable Configuration of the Social Auth which store the data provided by the implementer. This data is composed by a route and a path to an image. For instance, take a look at how Simple Facebook Connect supplies this information: https://github.com/GVSO/simple_fb_connect/blob/8.x-2.x-social_api/simple_fb_connect.install.

Regarding the icons, there is an open issue on where to get the images that the implementers will use at https://www.drupal.org/node/2697771. In later versions, site builders will be able to select which kind of icons they want to display (polygon, rectangular, rounded, etc.).

Drupal icon with different styles

Next week

For next week, I will be working on obtaining Facebook JavaScript SDK in Facebook Widgets module, which will allow contributed modules to implement Facebook Social Plugins like buttons, embedded contents, and comments. Furthermore I will port fblikebutton functionality to facebook_buttons, which will be the starting point for the first functional Social Widgets sub-module.

As always, feel free to contact me if you have any question. You can also collaborate with the Social Initiative projects (social_apisocial_authsocial_post, and social_widgets). We also have our weekly meetings, so follow the Social Initiative and join us on Fridays.

Stay tuned for the next weekly summary!

AttachmentSize
config_env4.png18.27 KB
block_layout.png80.36 KB
Social_drupal.png8.54 KB