A major rewrite of AddThis module is long overdue and we are finally starting to work on it. Major causes for the rewrite include moving to AddThis.com API 2.0, rewriting the theming to be more flexible and enabling more ways of limiting AddThis button visibility.

This is my current idea on features included in 3.0 and their priorities. All features will get implemented at some point but we will start working with priority 1 and work our way to 2 & 3 from there. Version 3.0 will not be backwards compatible, however upgrading will be made as easy as possible. If you have done any custom theming for the module you will have to redo most of it in order to use 3.0.

Next version of AddThis module will be implemented for D6 and ported to D7 when in beta, D5 will not be supported. Older 2.x versions of the module will only get critical bugs fixed after 3.0 has been published.

If you have any comments, ideas or feedback about the module now is the time. Implementation work starts on this week (8.-14.3.2010) and we expect to have the new version in beta some time in April 2010.

Features

  • Display button in full node display or teaser 1
  • Views integration: user Addthis as a view field 1
  • CCK field for AddThis 3
  • View AddThis as a block 1
  • API for limited visibility in node views 1
  • Upgrade to Addthis.com API 2.0
  • More flexible theming 2
  • Enable local caching and aggregation 2
  • Support for Addthis in RSS 1
  • New admin interface 2
  • Translation support 1

Comments

les lim’s picture

Thanks, wesku. Here's my breakdown of your feature list:

Features currently supported:

  • Display button in full node display or teaser 1
  • Views integration: user Addthis as a view field 1
  • View AddThis as a block 1

We're mostly making sure we don't break this basic functionality in the new version.

New functionality:

Upgrade to Addthis.com API 2.0
This is, of course, the primary reason for the rewrite in the first place.

Translation support 1
This should be low-hanging fruit. Passing $language->language into the addthis_config object should be enough.

New admin interface 2
Since AddThis now takes its default configuration as a single array (addthis_config) containing key/value pairs, we should rework the AddThis admin form to store the settings in the {variable} table the same way: as a single array of configured settings, keyed to the same keys as in the AddThis API. This will make loading the default settings much easier.

More flexible theming 2
I'm a big supporter of this. I would ideally like to be able to pass arbitrary $addthis_config and $addthis_share arrays directly into the theme function and have them override the defaults for that specific instance of the button.

Enable local caching and aggregation 2
This would be a killer feature. According to their FAQ, AddThis provides developers a certain URL from which to grab the code on request. Someone will need to follow up with them on this, I think.

les lim’s picture

Questions about some of those features:

API for limited visibility in node views 1
I'm sure I don't have any objection; I'm just not sure I know what you mean. Are you talking about turning the button on/off on a per-node basis?

Support for Addthis in RSS 1
+1 for this, but maybe as a separate module, packaged along with AddThis. The AddThis RSS button is for accomplishing something pretty different from the normal AddThis button, and the basic functionality should probably be kept apart.

CCK field for AddThis 3
What would be the point of making a CCK field?

les lim’s picture

Also, some features I'd like to see:

  • A new theme_addthis_toolbox() function for implementing toolbox code separately from button code.
  • Admin settings for determining whether to use the button or the toolbox by default.
  • Checkbox selection of services for the dropdown and the expanded menu. These lists are huge and would probably have to go on their own pages/tabs.
vesapalmu’s picture

Oh, it seems my secondary bullets were lost in copy-paste. Here is a second try:

* Display button in full node display or teaser 1
As it is today.

* Views integration: user Addthis as a view field 1
Pretty much as it is today, some clean up for the actual code.

* CCK field for AddThis 3
Primary reason for this would be to enable different settings for each node and limit visibility using Content permissions module. Also we could support any number of display formaters enabling different look for different content types. This would also open the door for many additional improvements, but it should definitely be an optional feature.

* View AddThis as a block 1
As is. Perhaps with different theming options?

* API for limited visibility in node views 1
This would replace all current ways of limiting the button visibility. By default the button would always be visible to everybody. A hook should be created to enable limiting the visibility. Examples could be limiting visibility by content type, taxonomy, menu or for each node. This would be answer to many different feature requests.

* Upgrade to Addthis.com API 2.0
Pretty obvious. Most features of 2.0 API should be supported, but most likely nyt all of them. This would require more analysis.

* More flexible theming 2
This is something I'm pretty open for feedback on. Separate theming for toolbox is a good idea.

* Enable local caching and aggregation 2
Turned off by default, but should be implemented the same way google analytics module does it.

* Support for Addthis in RSS 1
This is a common feature request. Separate submodule could be a good idea. We should anyway split at least the visibility limiting stuff as separate submodules.

* New admin interface 2
Also a clean up to make the module easier to use.

* Translation support 1
Easy to implement and definitely required.

We have a few people working on this. Architecture for 3.0 should be agreed on and then we can split the tasks of implementing different parts of the module. I also have some ideas about the future of content sharing in Drupal and will make a separate blog post about those soon...

onaz’s picture

Address book fuctionality #596818: No longer supports import of email contacts?? also requested in 3.0.

vesapalmu’s picture

#5 - This is one part of API 2.0 that should be supported. We need to walk trough the API and figure out what will be supported by configuration and also leave a way for advanced users to extend the module configuration.

Another thing missing from my original list are the context issues. We have to start using real URLs and figure out the context of the button. For example users want to use node urls in most cases where you list nodes (views, RSS), but you may also end up with addthis block on a view, taxonomy page or something similar. There are currently few issues about this, but I don't want to start changing the sharing logic for 2.x versions of the module.

vesapalmu’s picture

Issue queue cleanup continues. Moving another request here:

mrayyan:

I've just noticed that with AddThis API, you can easily setup a template for twitter and such. Where you can assemble something like this:

" I've just read this cool post {{title}} at {{url}} ~ check it out".

It will be great if AddThis can support this without hacking the code.

Agreed. This should be supported without hacking.

vesapalmu’s picture

Status: Active » Needs work
vesapalmu’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
les lim’s picture

StatusFileSize
new5.3 KB

Here's a possible starting point for the 6.x-3.x-dev branch leveraging API 2.0. No new features have been implemented, but I reworked the admin interface so that addthis_config options can be stored in a single variable to match the new API. The theme function has also been completely rewritten.

This should be fully functional, if feature-limited, but the admin options haven't been built out completely. I just put enough in there to make sure it would work.

Percept’s picture

Just an idea: Would it be possible to have drupal communicate with the addthis api trough this module so we could for example create a view depending on "most shared" items?

eojthebrave’s picture

Does the API allow us to query for a list of supported services? It might be nice if _addthis_services_list() could get the list of services via the API and cache it locally. That way we don't have to update the module every time AddThis adds a new service.

les lim’s picture

There's no API query for a list of services yet, but it looks like it might be in development:

http://addthis.com/forum/viewtopic.php?f=8&t=23360

I sent an email to the API developer asking about it.

les lim’s picture

Title: AddThis 3.0 roadmap » AddThis 3.0 dev candidate
Status: Needs work » Needs review
StatusFileSize
new5.58 KB

I took some time today to flesh out the module framework from #10 into something fully workable. The biggest changes are support for the AddThis Toolbox, which is totally sweet, and the decision to smash the services configuration back into the main configuration form. The checkbox-based configuration from the earlier effort didn't account for the need to place the chosen services in arbitrary order.

I'd invite improvements or replacements to some of the details of this implementation, particularly regarding the theme functions. But I do think the structure of the module is sound, and could serve as the basis for a 6.x-3.x branch which we can start submitting actual patches against.

Here's the list of features from this thread, separated by what's implemented in this candidate and what needs to be resolved.

Implemented:
Display button in full node display or teaser
Views integration: Addthis as a view field
View AddThis as a block
Upgrade to Addthis.com API 2.0
More flexible theming
New admin interface
Translation support
theme_addthis_toolbox function and admin option (#3)
Address book option on email shares (#5)
dynamic generation and caching for the services list (#12)

Not yet implemented:
CCK field for AddThis
API for limited visibility in node views
Enable local caching and aggregation
Support for Addthis in RSS
context issues (#6)
Share template support (#7)
API function to return a links array (#8)
Views integration with AddThis analytics (#11)

tsvenson’s picture

Looking forward to the release of this, subscribing.

AdrianB’s picture

Very interesting, subscribing.

dalin’s picture

One thing that I'd love to see with AddThis is better performance. Currently there are some easy opportunities for improvement. Currently the module adds a lot of JS/CSS/stuff during page load. These either block the page load, or just add more things that need to happen before the page is done loading. But since everything other than the button images are not required for page loading, they can be lazy loaded. Here's an example:

$(window).load(function(){
  var head = $("head").first() || document.documentElement;
  var script = document.createElement('script');
  script.type = 'text/javascript'; 
  script.async = true;
  script.src = 'some_script.js';
  head.insertBefore(script, head.lastChild);
});

This mimics the technique used by Google Analytics but more jQuery oriented. You can use the same technique to load CSS, iframes, or whatever else.

brucepomeroy’s picture

AddThis offers integration with Google Analytics. It would be great if this was an option in the AddThis module. So if someone has the AddThis module and the Google Analytics module on the same Drupal site there would be an option to have your AddThis activity tracked under GA. Thanks and great work!

archimedes’s picture

Does 3.0 support the AddThis Toolbox yet? (http://addthis.com/help/toolbox) If not, I'd like to suggest that we add that support...

Edit: Whoops. Looks like that was indeed answered above. Feel free to ignore this comment...

archimedes’s picture

I've been doing some more reading on some of the more recent developments of AddThis. In addition to Google Analytics integration (+1 brucepomeroy), I'd also like to see Facebook Like support (http://addthis.com/gallery/toolbox-facebook-like) and clickback tracking support (http://addthis.com/help/clickbacks).

What is the status of the 3.0 module update?

nancydru’s picture

According to my CEO, the only part he wants is the RSS as seen at http://sethgodin.typepad.com/.

izmeez’s picture

subscribing with interest

eojthebrave’s picture

@NancyDru, I believe that that is just a question of configuration. You should be able to configure the module to just display the "buttons" that you want. If however that's not the case you might want to open a new issue as this one is focused on a complete re-write of the module.

les lim’s picture

@eojthebrave: this isn't yet the case, unfortunately. In the past, the Addthis RSS button was an entirely separate offering than the regular Addthis service, and it couldn't be integrated into the regular button. The issue appears to be moot, since AddThis has since removed the RSS service from their website.

It does look like they might bring it back as a feature of the regular service, though: http://www.addthis.com/forum/viewtopic.php?f=4&t=25244

nancydru’s picture

@lesmana: It's good to know that I wasn't going blind because I couldn't find it.

@eojthebrave: I was mentioning as a priority setting suggestion, since it is listed above.

In the meantime, I just coded a replacement for the standard Drupal RSS item. It took a whole 5 lines of code.

eojthebrave’s picture

Oops, sorry for any confusion. :)

izmeez’s picture

@NancyDru

In the meantime, I just coded a replacement for the standard Drupal RSS item. It took a whole 5 lines of code.

Would you be willing to share your code for the RSS ?

Thanks,

Izzy

nancydru’s picture

  $base_url = 'http://' . $_SERVER['HTTP_HOST'] . $base_path;
  if (variable_get('forrester_feed_addthis', 0)) {
    $alt = 'Subscribe ' . $text;
    $button_image = theme('image', drupal_get_path('module', 'forrester_blogs_blocks') . '/addthis_rss.gif', $alt, $alt);
    $addthis_url = 'http://www.addthis.com/feed.php?h1=' . $base_url . urlencode(drupal_get_path_alias($where_to_go)) . '&pub=Forrester_Blogs';
    $link .= '<p>' . l($button_image, $addthis_url,
      array('html' => TRUE, 'attributes' => array('class' => 'underline')));
    $link .= ' '.  $text . '</p>';
  }
  else {
    $link .= '<p class="rssSubscribe">';
    $link .= ' '. l(t('Subscribe via RSS'), $where_to_go, array('attributes' => array('class' => 'underline')));
    $link .= ' '.  $text . '</p>';
  }

The else clause is what was there before.

les lim’s picture

Status: Needs review » Fixed

I completely missed that there was an official 3.x dev release until looking at the project page just now. Posting notice here for anyone tracking this issue.

It looks like almost all of my code from #14 was included as-is in the release. A note of attribution on the project page or the README.txt would be nice to see.

Marking this fixed -- issues related to the official dev version should be created separately.

vesapalmu’s picture

Sorry about missing the attribution originally lesmana. I just added it to README and we will also try our best to mention any contributors in commit and release notes.

Status: Fixed » Closed (fixed)

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