Add to groups' social media accounts?

Has anyone got a good way to add to the list of a group’s social media accounts in Group Settings? We have a request for LinkedIn here.

I would probably just add a custom field to the backend, per Custom Fields - LiveWhale Support, using something like…

[
    'header'=>'LinkedIn Account',
    'name'=>'linkedin_name',
    'content_type'=>'groups',
    'type'=>'text',
    'is_required'=>false,
    'place_after'=>'SOCIAL_MEDIA'
]

Now, that will just add a separate fieldset below the Social Media Accounts box, which may not be what you want. But you could then add some backend JS to move that field where you want it…

<script>
var $linkedInContainer = $('<div class="form-group"><div class="input-group"><label class="lw_sr_only" for="custom_linkedin_name">LinkedIn Username</label><span class="input-group-addon"><span class="fa fa-linkedin"></span></span></div></div>').appendTo('.fields_social_media fieldset');
$('#custom_linkedin_name').attr('placeholder','LinkedIn Username').appendTo($linkedInContainer.find('.input-group'));
$('.fields_linkedin_name').remove();
</script>

There may be a better way to do this, but it worked for me in a quick test.

1 Like

Thank you, Jon! That worked great.

1 Like