How to Install ShareThis’ Tools on Drupal

Installing ShareThis Tools with Javascript Code

  1. Log in or Sign up to the ShareThis Platform.
  2. Select the ShareThis tool you would like to use and activate it by clicking the Enable tool button. 
  3. Then, customize the buttons by selecting your social channels, size, and shape.
  4. Select the Activate code button in the top right corner. In the pop-up, click the Copy code button.
  5. Log in to your Drupal website. 
  6. For convenience, you could install and Activate the Header and Footer Scripts plugin to insert the script code:
  7. Navigate to Configuration page: Administer > Configuration > Development > Header Footer Scripts Page.
  8. Paste the code from Step 4 into Header Scripts.
  9. Click on Save Configurations.

Adding Inline ShareThis Tools

Inline tools require an extra snippet of code to work on your site. If you would like to install our Inline Share Buttons, Follow Buttons, Reaction Buttons, or Social Feed tools on your website, you will need to add placement code wherever you want the tool to appear. To learn more about ShareThis Website tools, go here.

You can choose between:

Editing the Theme Code

  1. In your ShareThis Platform, select the ShareThis tool you want to use and copy the placement code. Depending on the tool you are installing, the code should look similar to this:<div class="sharethis-inline-share-buttons"></div>
  2. Log in to your Drupal website. 
  3. In the Manage administrative menu, navigate to Structure > Block layout > Custom block library (admin/structure/block/block-content).
  4. Click Add custom block.
  5. Name the block. Inside the Body, toggle the Source as HTML Code and place the ShareThis placement code.
  6. Click Save.
  7. Go to Block Layout and place the newly created blog wherever you want your buttons to appear.
  8. Click on Save Blocks.

Editing a specific article or post

  1. Create an article.
  2. In the body of the article, toggle the Source as HTML Code.
  3. Place the ShareThis placement code wherever you want it to appear in your article/post.
  4. Click Save.