On the front page, we have a bunch of teasers...and each one has an 'add this'...which is great
But if I 'add this' on the teaser, it adds the URL of the page with the teaser (ex: http://example.com) and not the NODE that the teaser referers to (EX: http://example.com/node/1)

ANyway to make this work?

Thanks!

rwc

CommentFileSizeAuthor
#1 teaserlink.addthis.patch2.06 KBRichard Blackborder

Comments

Richard Blackborder’s picture

Status: Active » Needs review
StatusFileSize
new2.06 KB

Here's a patch that adds this feature. I've made it always on, because it seems to me that if you wanted a link to the current page, you'd use the Add This block. I think any user would expect the teaser buttons to add the node itself, not the page of the teaser.

Note: this patch is of version 6.x-2.0-beta3.

vesapalmu’s picture

Status: Needs review » Fixed

Thanks for the patch Likeless, it fixes the issue. I commited the patch to CVS and will roll out a new release soon.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

dagomar’s picture

Version: 6.x-2.0-beta2 » 7.x-2.1-beta1
Status: Closed (fixed) » Active

If I am cluttering the issue cue here, I am deeply sorry. I think this is not working on my drupal 7 install. It's the same issue, all addthis buttons in the teaser point to the front page. Looking into the issue.

** edit **

Tracked the issue to line 179 of addthis.module. It seems "$node" is not an object and it's not passed in the $variables

** edit 2 **
Got it working. I don't know how to make patches, and I am not sure if what I did is the right way. I'll post what I did step by step, it's quite simple (I'm replacing the lines, passing the node info along each step):

line 35:
'#markup' => _addthis_create_button(array('build_mode' => $build_mode), $node)
line 148:
return theme('addthis_button', array('build_mode' => $build_mode, $node));
line 155:
$build_mode = $variables['build_mode']['build_mode'];
line 177,178

      ($build_mode == 'teaser') ? url('node/'. $variables[0]->nid, array('absolute' => 1) ) : '[URL]',
      ($build_mode == 'teaser') ? addslashes($variables[0]->title) : '[TITLE]',
monican’s picture

I'm also on Drupal 7, and have the same issue. I will try the changes suggested in #4 as a workaround, but wesku might want to fixing the code so no hacking is needed for updates. Thanks dagomar.

kappaluppa’s picture

I tried the above changes and I am still not getting a link to the node listed in the teaser, but to the main page where the teasers are listed.

Will this issue be address in the upcoming 7.x-4.x release?

Thanks,
K

matglas86’s picture

The 4.x release is a complete new implementation. It handles this already indeed.

matglas86’s picture

Status: Active » Fixed

Fixed in 4.x release.

Status: Fixed » Closed (fixed)

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