You want to add a social media share to your Drupal site, but there’s nothing included in the core to make that possible. No need to worry, the AddToAny Share Buttons module has you covered.
Drupal enables continuous digital innovation at leading organizations like Weather.com and NBCUniversal. With Drupal, marketers and web developers can create and manage great web, mobile and social experiences. And they can improve and adapt quickly thanks to ongoing innovation and ideas from the Drupal community. With the help of Open Social, it builds the bridge between the UN, governments and the private sector by encouraging collaboration and knowledge-sharing. Social media is becoming very important these days, Drupal has many social media modules for this purpose. Let us take ShareThis module as our example, you can choose any other of your choice. Following are the simple steps used to install ShareThis module.
It may not be surprising that Drupal hasn’t always supported social sharing when you consider that Drupal predates social media! When Drupal 1.0.0 was released, there was no such thing as an iPhone. It would be years before Facebook, Twitter, or Instagram were created.
Social Media Links Block and Field (Drupal 8, Drupal 7) “The modules provides a configurable block that display links (icons) to your profiles on various popular networking sites. Current supported Social Networks: Facebook, Twitter, Youtube, Google+ and many more). Drupal is ideally equipped to be used as a base system for creating a custom social networking site like Facebook and MySpace. While these large social networks have their place, niche social networking web sites can help promote businesses, products, projects, and hobbies of any nature.
Of course, we have social media now, everywhere, so adding the ability to make sharing easy on your Drupal site is essential. Luckily, adding social media sharing to Drupal is easy.
How easy? Let’s take a look.
How to Install AddToAny Share Buttons on Your Drupal Site
To install AddToAny Share Buttons, go to the AddToAny Share Buttons page on Drupal.org:
Scroll down to the “Downloads” section at the bottom of the page and right-click (Ctrl-click on a Mac) on the tar.gz or .zip link for your version of Drupal.
Click “Copy link address” (we’re not downloading the file, just grabbing the URL).
- If you don’t see your Drupal version listed, click the “View all releases” link.
- Choose the link “Recommended by the project’s maintainer.” Avoid installing the development version of any module on a live production website.
Go to your Drupal admin screen. Click the “Extend” link in your site administration navigation.
Click the “Install new module” button.
In the “Install from a URL” field, paste the link that you copied from the module page.
Click the “Install” button.
Click the “Enable newly added modules” link.
You’ll be taken to the “Extend” page. Scroll down (or search) to find the AddToAny Share Buttons module and select the checkbox.
Click the “Install” button at the bottom of the page.
Social Media Share on Drupal
Once the AddToAny Share Buttons module is installed and enabled, a few sharing buttons will appear on your articles and pages.
The Drupal Facebook share is there, as well as Twitter, and a “+” icon (called the “Universal Button”) that opens up to share buttons for other services.
Then there is an additional “More” button that exposes even more service buttons.
If that’s not enough for you or a service you want to link to isn’t included, there are even more services available from AddToAny.
When a visitor clicks one of the buttons, a pre-populated post pops up.
Configuring AddToAny Share Buttons
As I mentioned, after installing and enabling the AddToAny module, you have social media share on Drupal articles and pages. You can change where the buttons appear by editing the AddToAny entities.
Go to Home » Administration » Configuration » Web services » AddToAny
In the “Entities” section, you can control where AddToAny appears.
Remember to click the “Save configuration” button if you make any changes.
In “Buttons,” you can control the appearance of the AddToAny Share Buttons.
Icon size is just what it says, the pixel dimensions of the button graphics. To make the buttons smaller, enter a lower value, to make them larger, a higher value.
Service Buttons and the “Service Buttons HTML code” field are where you control which buttons are visible before the user clicks the Universal Button (+).
By default, it contains the Drupal Twitter share and Facebook icons. But you can add to those, or even change them out completely.
Remember when I said there were more services available from AddToAny? If you click on the service you wish to add from that list, it will take you to a page where you can find the “AddToAny service code.” Copy that.
Now format the service code into the button markup like so (the AddToAny service code is bold):<a class=”a2a_button_linkedin“></a>
and add it to the “Service Buttons HTML code” field.
Scroll down and click the “Save configuration” button.
Then the button is added to the default social share view.
That’s a Wrap on AddToAny
Now that you know how to add social links to your Drupal site, you’re on the road to increasing your social sharing.
Increasing SEO for your website is the best way to increase your traffic from search engine results. But social media is a great way to generate traffic that doesn’t rely on search results.
If you can get your articles shared consistently on social media, the traffic you gain can easily overshadow search or direct traffic. Investments in social sharing can reap great dividends.
Have you used other methods to add social media share options to Drupal? Do you know how much of your site traffic comes from social sharing?
Author: Michael Phillips
Michael Phillips is a web hosting industry veteran, helping people make the most of their web presence since 1995.
Was this article helpful?
- Drupal Basics Tutorial
- Drupal Advanced
- Drupal E-Commerce
- Drupal Useful Resources
- Selected Reading
Drupal Social Media Block
In this chapter, let us study about Social Networking in Drupal. Social media is becoming very important these days, Drupal has many social media modules for this purpose. Let us take ShareThis module as our example, you can choose any other of your choice.
Following are the simple steps used to install ShareThis module.
Drupal Social Network Module
Step 1 − Click ShareThis to visit ShareThis module page and click the Version as shown in the following screen.
Step 2 − Copy the link address of the module as shown in the following screen.
Step 3 − Next, go to Modules and click Install new module as shown in the following screen.
Step 4 − Now, paste the link address that you copied in step(2) and click Install as shown in the following screen.
Step 5 − You will see the following screen. Click Enable newly added modules.
Step 6 − Next, go to Modules. Enable the module and click Save configuration as shown in the following screen.
Step 7 − Go to Configuration, under WEB SERVICES and click ShareThis as shown in the following screen.
Step 8 − The following screen pops up.
Step 9 − You can click any of the button style, under the Display section to share your content online as shown in the following screen.
Step 10 − Click any of the services you want to remove. You can also use Extra services like Google Plus One and Facebook Like by checking them as shown in the following screen.
You can choose services from the Possible Services section and you can also remove or re-order services from Selected Service section.
Drupal Social Login
Step 11 − Next, click Context as shown in the following screen to configure where the ShareThis widget should appear.
Following the details of the fields present on the screen.
Under Location you can choose any of Node content or Block or Links area.
Under Node Types you can select Article and Basic page, if you want ShareThis widget to appear on it.
If you select Comments you can display ShareThis on comments as well.
The Weight of the widget determines the location on the page where it will appear.
Step 12 − Next, select Advanced as shown in the following screen.
Following are the details of the fields present on the preceding screen.
When you install the module, a random publisher key will be created.
Twitter Suffix will optionally append a Twitter handle, or text, so that you get a ping when someone shares an article.
Twitter Handle will be used when sharing on twitter.
Twitter recommends will specify a twitter handle to be recommended to the user while sharing.
If Display ShareThis widget on hover is disabled, ShareThis widget will be displayed on click instead of hover.
If Display count '0' instead of 'New' is checked, zero is displayed instead of New in the count for content not yet shared.
Display short URL will display either the full or the shortened URL.
CopyNShare will measure copy and shares of your site's content or URLs as checked respectively.
Step 13 − After checking all the details, click Save configuration as shown in the following screen.
Drupal Social Networking
Step 14 − Now you can see the social media buttons appearing on the Article page.