Hello,

is there any way to include the Facebook share button also? Like button works fine but we need the Share too.

Thank you

Comments

alfarider’s picture

need the same button

tce’s picture

Just installed this module and was really hoping this was an option. There's an api to add widgets, maybe it's possible to add this functionality via a custom module. I might give this a try.

tce’s picture

It's actually quite easy to add the share button via a custom module, example code below:

<?php
function MYMODULENAME_easy_social_widget() {
  return array(
    'facebook_share' => array(
      'name' => 'Facebook Share',
      'markup' => 'facebook_share_button_markup',
    ),
  );
}

function facebook_share_button_markup($url, $type, $title = NULL, $lang = 'en') {
  return <<<HTML
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-share-button" data-href="{$url}" data-type="button"></div>
HTML;
}
?>

The new widget will then show in the admin page where you can enable it and sort the widget order. Any other settings would have to be done by changing the code from https://developers.facebook.com/docs/plugins/share-button/

tce’s picture

Just realized there is an answer to this question already: https://drupal.org/node/1540576

tce’s picture

Status: Active » Closed (works as designed)
Carlos Miranda Levy’s picture

Tried above, as custom module and enabled it.
Does not show up as an additional widget.

tce’s picture

Does it not show up at all in the admin section for it to be enabled?