This project is not covered by Drupal’s security advisory policy.
Features
* Share This Thing is a simple module for exposing sharing options for the selected content-types.
* Creates a new "view_mode" for content to be embedded. So you can really choose what content should be displayed in those IFRAMEs.
* IFRAME width and height values are configurable separately for each content-type.
* Supports "Shorten" and "Yourls" modules for URL shortening options. In absence of these modules, exposes non-aliased full URL. i.e. http://example.com/node/123
* Provides an option for you to include your favorite sharing and/or bookmarking services below the Short URL and Embed code fields.
Dependencies
Recommended
To provide short URLs, either install and configure one of these modules, or implement your own solution using theme_share_this_thing_link()
.
Known Issue
The widgets added in "Additional HTML" field may require you to manually include a method to re-initialize the widgets.
The reason for this is the Ctools modal window uses AJAX to load its content. When the modal window is closed, the referenced JavaScript libraries would stay attached to the DOM. However, those widgets may need to be re-initialized to function properly.
See API documentation for those widgets.
AddThis
http://support.addthis.com/customer/portal/articles/381263-addthis-clien...
ShareThis
http://support.sharethis.com/customer/portal/articles/439323-api-overview
Solution for AddThis:
Include following JavaScript below the AddThis snippet:
// Re-initialize toolbox and/or counter.
if (window.addthis) {
addthis.toolbox(".addthis_toolbox");
addthis.counter(".addthis_counter");
}
Configuration and integration examples
AddThis integration example:
To make sure AddThis buttons inherit to correct content title and URL, include addthis:title and addthis:url attributes respectively to the .addthis_toolbox
element.
See "Configuration Inheritance" at Addthis Client API documentation:
http://support.addthis.com/customer/portal/articles/381263-addthis-clien...
Include following JavaScript before AddThis (re-)initialized:
(function ($) {
$("#share-this-thing-form").each(function() {
$(".addthis_toolbox", this).attr({
"addthis:url": $(".stt-share-link", this).val(),
"addthis:title": $(".stt-share-link", this).attr("title")
});
})
})(jQuery);
API
Following theming function are available for you to customize "Share This Thing" in your theme:
// Theme modal window title.
theme_share_this_thing_title()
// Theme the IFRAME embed code displayed in modal window.
theme_share_this_thing_embed()
// Theme the short URL displayed in modal window.
theme_share_this_thing_url()
// Formats the share link opening modal window.
theme_share_this_thing_link()
// Process variables for share-this-thing-html.tpl.php
template_preprocess_share_this_thing_html()
Change modal window title in your theme.
/**
* Implements theme_share_this_thing_title().
*/
function THEMENAME_share_this_thing_title($variables) {
return t('Your modal window title');
}
Enables sharing content via short URL, embed code and social network services.
Sponsorship
This project is developed by Osman Gormus and sponsored by Project6 Design, Inc., a leading Drupal design firm in the San Francisco Bay Area. Visit us at www.project6.com or contact us at drupal@project6.com
Project information
- Module categories: Integrations
- 11 sites report using this module
- Created by osman on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Development version: 7.x-1.x-dev updated 19 Nov 2012 at 07:28 UTC