There are two issues here. The first is that any "Share" link in a list of teasers (the front page, for example) only affects the first node in the list.

Second, I'm unable to remove the "Share" link from teasers. Both Forward and Service Links are configured to display only on full-page view.

Comments

greenskin’s picture

Status: Active » Postponed

I'll work on the teaser issue when I get more time, but the 'share' link showing up always on teasers has been fixed. Additionally, I set some validation in the Service Links settings page so if Share is turned on, it won't let you set links to teasers, and you can't have Service Links in the node AND in links.

ahneill’s picture

Excellent to hear the teasers are going to be worked on... this feature is largely needed on teasers to cut down clutter on pages where numerous teasers appear, at least for us... I am promising at least $25 if the share feature can be made to work with teasers. THANK YOU!

greenskin’s picture

Status: Postponed » Fixed

Teasers should work now. Let me know if there are any problems.

greenskin’s picture

Status: Fixed » Closed (fixed)
michelle’s picture

Version: 5.x-1.x-dev » 5.x-2.0-alpha1
Category: bug » feature
Status: Closed (fixed) » Active

This seems to be broken again on the 2.x line. I'm looking at the code:

function share_link($type, $node = NULL, $teaser = FALSE) {
  switch (variable_get('share_type', 0)) {
    case "share_this":
      if (variable_get('share_share_this_where', 0) == '0') {
        static $share = 0;
        if (_share_share_this_show($node->type, $node->nid) && user_access('use share this')) {
          if ($share == '0') {
            $share++;
            drupal_set_html_head(variable_get('share_share_this_code', 0));
          }

          $links['share_share_this'] = array(
            'title' => "<script language='javascript' type='text/javascript'>
              SHARETHIS.addEntry({}, {button:true} );
              </script>",
            'html' => TRUE,
            'attributes' => array('id' => 'share_'.$node->nid)
          );
          return $links;
        }
      }
      break;

and it doesn't look like it's checking to see if the link is going on a teaser and I can't find anything in options to set it.

I changed it to:

    case "share_this":
      if ($teaser) {
        return array();
      }
      if (variable_get('share_share_this_where', 0) == '0') {

And that works fine for my purposes but adding an option would make it better for general use.

Thanks,

Michelle

scottrigby’s picture

Michelle - this works great!

I still haven't figured out how to make a proper patch, otherwise I would.
(A hole in my knowledge... will look into how to do this soon...)

Thanks for this!

:))
Scott

greenskin’s picture

Status: Active » Fixed

Fixed, please test next available snapshot.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.