This project is not covered by Drupal’s security advisory policy.

Share This Thing modal window
Share This Thing options per content type


* 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.

* Provides an option for you to include your favorite sharing and/or bookmarking services below the Short URL and Embed code fields.



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.



Solution for AddThis:
Include following JavaScript below the AddThis snippet:

// Re-initialize toolbox and/or counter.
if (window.addthis) {

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:

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")


Following theming function are available for you to customize "Share This Thing" in your theme:

// Theme modal window title.

// Theme the IFRAME embed code displayed in modal window.

// Theme the short URL displayed in modal window.

// Formats the share link opening modal window.

// Process variables for share-this-thing-html.tpl.php

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.


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 or contact us at

Project information