From 287960bcb52b8cca059b53e55210171ed4b09e23 Mon Sep 17 00:00:00 2001 From: Marton Kiss Date: Sun, 23 Aug 2015 11:17:42 +0200 Subject: [PATCH] Commons twitter url display override Override the user-user-field_twitter_url's display settings, add profile_teaser display with groups_link_social_formatter. Change-Id: I3eeeb5bedb28101a4a59cb66b0577cec88d1b7d3 --- .../groups_user_profile.module | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/modules/groups/groups_user_profile/groups_user_profile.module b/modules/groups/groups_user_profile/groups_user_profile.module index c3bb215..9d42c94 100644 --- a/modules/groups/groups_user_profile/groups_user_profile.module +++ b/modules/groups/groups_user_profile/groups_user_profile.module @@ -7,6 +7,22 @@ include_once 'groups_user_profile.features.inc'; /** - * @file - * Code for the Groups User Profile feature. + * Implements hook_field_default_field_instances_alter() + * + * Add profile teaser settings to user profile's twitter url + * field. */ +function groups_user_profile_field_default_field_instances_alter(&$fields) { + if (isset($fields['user-user-field_twitter_url'])) { + $field = &$fields['user-user-field_twitter_url']; + $field['display']['profile_teaser'] = array( + 'label' => 'hidden', + 'module' => 'groups_social_link', + 'settings' => array( + 'provider' => 'twitter', + ), + 'type' => 'groups_social_link_formatter', + 'weight' => 2, + ); + } +}