Last updated 4 December 2015. Created on 4 December 2015.
Edited by fabianderijk. Log in to edit this page.

The social feed field module makes it possible for editors to create a list of social media posts in a entity that are combined and ordered by created date from several different social media channels.

The module creates a new field type that site builders can add to entities.

Installation

  • Install as usual
  • You can also enable one or more of the submodules.

Basic usage

Permissions

Configure user permissions in Administration » People » Permissions:
Administer social feed field
User roles with this permission are able to configure this module and submodules.

Module configuration

Customize the setting in Configuration » Content authoring » Social feed field
On this page you can configure multiple settings. Both the main module as the submodules that implement our hook have their settings displayed here.

On this page you can setup api keys for the submodules. Keep in mind that you have to create them yourself. The submodules that are included in this module have some documentation or some help pages available for this and are shown in the fieldset of these channels.

Both Twitter and Facebook require you to connect through Oauth. For both channels the submodules (will) provide step by step help and some automagical configuration.

Usage

Next you can add a field to a entity of the type Social Feed Field. On this field you can setup which channels you want to use, image styles to use and some default settings.

API documentation

API documentation is available in the social_feed_field.api.php file. In there the hook_social_feed_fields_channel() is explained.

Sample snippets

A sample snippet for the hook_social_feed_fields_channel() as also provided in the api file:

/**
 * Provide a channel that is used in the social feed field.
 *
 * @return array
 *   The defined new channel.
 */
function hook_social_feed_fields_channel() {
  return array(
    // The key of the array is the machine name of the channel.
    'channel_name' => array(
      // The readable name of the channel.
      'name' => t('Readable channel name'),
      // The channel description. This is used as the description below the form
      // field.
      'description' => t('Channel description.'),
      // The callback function. This function MUST always return a array with
      // the rendered items.
      'callback' => 'callback_function_name',
      // Optional: The path to the file containing the callback.
      'file' => 'path/to/file/containing/callback',
      // Optional: Form fields used for configuration. You should use these
      // values for things like access tokens, or api keys.
      // These values are eventually used in a function that uses the Form API.
      // That's why you can use every kind of Form API elements.
      'admin' => array(
        // Optional: A description used in the created fieldset on the
        // admin page.
        '#description' => t('Admin fieldset description'),
        // Fields used in the admin screens.
        'consumer_key' => array(
          '#type' => 'textfield',
          '#title' => t('Consumer key'),
        ),
        'consumer_secret' => array(
          '#type' => 'textfield',
          '#title' => t('Consumer secret'),
        ),
        'some_other_settings' => array(
          '#type' => 'select',
          '#title' => t('Some select list'),
          '#options' => array(
            'Options 1',
            'Options 2',
            'Options 3',
          ),
        ),
      ),
    ),
  );
}

Troubleshooting

For troubleshooting search the issue queue or create a new issue with your bug or question.

Theming

For now each item in the feed can have it's own theme function and templates. All the submodules use this. There is 1 shared template used for rendering youtube embeds from social feeds called social-feed-yt-embed.tpl.php

Sponsoring

Social feed field is sponsored and maintained by Finalist and initially developed for Maastricht University.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.