Drupal 7 Tweet/Plus/Like Module

Drupal 7 Tweet Plus Like Module Buttons

We created this Drupal 7 module for this site but have decided to let you all in on the action. The Drupal module will automatically add Twitter "tweet", Google "Plus One" and Facebook "like" buttons to the end of certain content types.

Using the Module

  • Upload to your Drupal 7 site
  • Install the module
  • Configure the module (admin/config/social/beacon9-social)

The module is very, very simple right now, if you have any good ideas of how to improve it, let us know!

Spread The Love

Comments

cheese's picture
posted by cheese on Jan 31 2011

i don't want to show the share buttons on the frontpage. only in the node when somone click on it.

how can i realise this?
Thanks!

jack's picture
posted by jack on Jan 31 2011

we could add an option to the module settings that would allow you to chose if you wish to show the buttons in teaser view, full view or both.

is that what you want?

jack's picture
posted by jack on Jan 31 2011

I updated the module to include this option for you... let me know if that helps.

Tim's picture
posted by Tim on Feb 11 2011

great job on the blog.

jack's picture
posted by jack on Feb 26 2011

Just uploaded a new version, a feature and a bug fix to the module.

jack's picture
posted by jack on Feb 26 2011

Apologies if you downloaded the 1.3 version... it looks like we levt the via @beacon9 in there. Update to 1.4 to correct this issue.

Ryan Price's picture
posted by Ryan Price on Mar 14 2011

Is there a reason why you don't upload this as a project on Drupal.org?

jack's picture
posted by jack on Mar 15 2011

Hi Ryan, I want to... the process is more than a little confusing so it's taking me a while to figure it out.

Ryan Price's picture
posted by Ryan Price on Mar 15 2011

Jack,

You've got the first step down - put your code out there.

Next, I would run it through Coder module to check for style and obvious problems that can be checked automatically.

If you have a d.o account, make sure you have agreed to the Git Terms of Service. We have a new "sandbox project" classification, which is the default when creating a new project. This part is new, so it is hopefully a bit easier now.
http://drupal.org/node/1068950

Once it's up there, and you've reviewed it (or maybe asked a friend to), you have to go through a one-time approval process. After that you can make new projects. Basically, you fill out a form and subject yourself to some scrutiny.
http://drupal.org/node/1068952

I am liberatr on Drupal.org, so I may be checking in with this project when you get it up there.

Have you seen
http://drupal.org/project/tweetbutton
http://drupal.org/project/fb_social
http://drupal.org/project/buzzthis

I saw yours on my way to finding these projects - yours was a one-stop shop, these are each configured on their own.

jack's picture
posted by jack on Mar 15 2011

Hey Ryan.

Thanks for that, its the git part where I'm struggling, I think I need a client with a GUI! I'll try and find some time this week to get this module and the sitemap block modules up on drupal.org

I'd like to add options to this module where you could select the social buttons that you want to include and add new buttons with sub-modules... that's next on the dev list.

Ryan Price's picture
posted by Ryan Price on Mar 15 2011

This is starting to sound a lot like Service Links or a similar module:
http://drupal.org/project/service_links

For now I have hacked parts of the three modules I mentioned above into a preprocess function in my theme.

For a guide to learning Git, check out this one by my friend Mike:
http://drupaleasy.com/blogs/ultimike/2011/03/learning-git-amateurs-persp...

Chris's picture
posted by Chris on Mar 17 2011

Hi, i'm french and didn't speak very well english.
I try your module it's look like beautiful, but i have a problem with alignment.
How can i align all the 3 buttons ?
Thanks a lot for your help

jack's picture
posted by jack on Mar 18 2011

Hi Chris. The buttons can be a little tricky to align as they are all different sizes. I added these styles to my theme to get them more inline...

.beacon9-social .beacon9-social-item { display:block; float:left; width:110px; height:30px; line-height:1.2em; }

Chris's picture
posted by Chris on Mar 18 2011

Hi, thanks a lot for your response ! It's work very well !
Thank you ;)

Markus Larsson's picture
posted by Markus Larsson on Apr 01 2011

Hi!

Can I use this module through panels? Can't seem to find it among the content.

jack's picture
posted by jack on Apr 05 2011

I haven't added any support for panels... as I've never had to use that module. What is it that you are trying to achieve?

Andrea's picture
posted by Andrea on Apr 10 2011

Any quick example on how to add this to my node.tpl? like
<?php echo render($content['socialthingie']) ?>

jack's picture
posted by jack on Apr 10 2011

Hi Andrea, you should be able to use this... if(isset($content['beacon9-social-bottom'])){ print render($content['beacon9-social-bottom']); }

Andrea's picture
posted by Andrea on Apr 11 2011

Thanks! :)

Gezzbanger's picture
posted by Gezzbanger on Apr 18 2011

Hey, Got a bug to do with permissions.
'admin/people/permissions' is white screening and php logs show the error message as above;
Fatal error: ....modules/user/user.admin.inc on line 697.
Drupal 7.0
Problem was fixed by de-activating module.
Shame, I liked the module

jack's picture
posted by jack on Apr 18 2011

Hey - are you using the most recent version of the module (1.4)?

gezzbanger's picture
posted by gezzbanger on Apr 19 2011

Thanks Jack.. I was using V 1.2
Problem is solved with v1.4
Two thumbs up !

TheUllrich's picture
posted by TheUllrich on Apr 27 2011

is there away to remove the google buzz?

jack's picture
posted by jack on Apr 28 2011

not within the module settings. if you open up beacon9_social.module and comment out line 118, that will do the trick.

Mik F's picture
posted by Mik F on May 09 2011

Hi,
all installed and configured but no links showing on my nodes :(
I initially got an error:
Notice: Undefined index: (node type) in beacon9_social_node_view() (line 92 of /sites/all/modules/beacon9_social/beacon9_social.module).

I updated this line like so:
if(isset($node->uri['path']) && (isset($enabledTypes[$node->type])) && $contentTypes[$node->type] != null && ($nodeTypes == $view_mode || $nodeTypes == 'both')){

This got rid of the roor but I'm not sure whether this has caused the module to fail.

Will keep an eye out for updates here and on Drupal for when you get the module hosted there. Can't wait as it looks great on your site!

jack's picture
posted by jack on May 09 2011

Hey Mik F,

I will look into the errors and post back once I've found a solution.
In the time being, please check that you have enabled at least one content type in the module settings.

Thanks.

Mik F 's picture
posted by Mik F on May 09 2011

I've enabled for all content types except 'Poll'
Node Type = Full Nodes and Teasers
Button Type = Button + Count on Side
Facebook Color Scheme = Dark

theullrich's picture
posted by theullrich on May 10 2011

Hey developing a new web site
www.walterwoodskiing.com
can you please go there and tell me when i like something it pops up on Facebook with a random sponsors logo?

jack's picture
posted by jack on May 10 2011

interesting... in the next module update I will get the module to use the default site logo (if one has been set).

theullrich's picture
posted by theullrich on May 10 2011

is there a temp fix for this?

ATE design's picture
posted by ATE design on May 10 2011

Could we have a simple means of turning on or off the different function calls. E.g. I have never used Buzz and never had any demand to from clients. A UI for turning on/off would be great.

In regards to doing it in the module itself? Any suggestions?
Otherwise great module, thanks very much!

jack's picture
posted by jack on May 10 2011

absolutely... thats next on the dev list... I'll post an update soon.

John Tapsfield's picture
posted by John Tapsfield on May 10 2011

Amazing. Loving the module. I wonder what the response time of putting this all through Views is? We had a triggered views series of social media links.
Which we use for our homepage icons and on articles.

We use a lot of views in our sites. Any ideas as to this versus just outputting on a block/node as it currently does.

Your module seems very lightweight and bundled. Also a personal request. Maybe include Behance or linked In? (Please :)

Great work. Is the module on the drupal.org/modules section yet.

jack's picture
posted by jack on May 10 2011

Hi John,

Glad you like it :-)

I'm trying to think of a benefit to using views instead of this... do you think it would be more flexible?

The goal is to make the module extendible, where we can add/remove any number of additional links... based on the feedback I've received this week, looks like there is a lot of demand for development on this. I'll get a new version out soon.

still not on Drupal... I can't, for the life of me, figure out GIT. I'll get there... thanks everyone for bearing with me.

Marsh's picture
posted by Marsh on May 22 2011

Hi John, great module :)

get an error when I like to fb, though. says:
"you like this. · Add comment · Error",

has worked up until then, and doesn't do this for #1 account - just other people (the ones I want to use it :(

I am running on localhost, though... will this make a difference?

jack's picture
posted by jack on May 22 2011

Marsh - running on localhost is almost definitely the problem ;-)

True Vine Productions's picture
posted by True Vine Produ... on May 24 2011

Dude... awesome plugin...
I've searched for exactly this for days to add to a website I just designed :D
Worked perfectly after adding the css code snippet you provided above.
Thanks a lot.
Check it out on the website :D

chrishrmnn's picture
posted by chrishrmnn on May 26 2011

Very nice module !
But to display buttons I must add the PHP Code on my .tpl.php. Don't know if it's a bug, I use the last version !

It will be very usefull if every buttons will have a "block" (three blocks : FB Button / Tweet Button / GBuzz Button). The module would be more flexible and personnalisable ... ;)

jack's picture
posted by jack on May 26 2011

hey CHRISHRMNN, you shouldn't have to add any code to your theme... which theme are you using?

I'm not sure blocks is the right way to go about this... I think more themes would have trouble getting buttons to line up etc. Are you thinking it would be nice to re-order and show/hide certain buttons.... I am working on that ;-)

Vince's picture
posted by Vince on May 31 2011

Doesn't install?
"beacon9_social-7-1.4.zip does not contain any .info files."

jack's picture
posted by jack on May 31 2011

you'll need to extract (unzip) the files before you try to install.

valery's picture
posted by valery on Jun 17 2011

Hi! Thank you for great module!
But could you help me.
I create pages with Views in Drupal 7. Is it possible that your module work on these pages? And I don't know why but I can't see buttons in teaser?
(I download latest version and choose "Full Nodes and Teasers".
Thanks.

jack's picture
posted by jack on Jun 24 2011

Hi Valery, I will take a look and get back to you with an update for the module. Make sure you subscribe to replies so you know when there is a fix.

Delzhand's picture
posted by Delzhand on Jun 21 2011

I just downloaded and installed the module - it's nice to have a simple, all in one solution. Got a question about the tweet part, though. I've seen some other modules that do this but I haven't had a moment to pull them apart - would it be possible to include a #tag or @tag in the 'content' of the generated tweet? It looks like either the module or twitter will populate the tweet with the page title, so there's some functionality there, I'm just not sure how to manipulate it.

jack's picture
posted by jack on Jun 24 2011

yes - that certainly is possible. will definitely include that in the new version (coming soon)

Walter's picture
posted by Walter on Jun 29 2011

Loving this module, any easy way to add things like google +1 and linkedin, etc?

jack's picture
posted by jack on Jul 01 2011

Not right now unless you are comfortable with php coding. A suitable alternative might be AddThis.

martijn's picture
posted by martijn on Jul 14 2011

Hi,
Great module, would also love google plus +1 and linkedin support.
And is this module coming to drupal.org? I think you will have more feedback and may be patch support on Drupal.
Greetings, Martijn

jack's picture
posted by jack on Nov 26 2011

Just added support for Google Plus button rather than Google Buzz.

Matt's picture
posted by Matt on Dec 16 2011

I tested the twitter button, but it doesn't seem to include the URL in the tweet? Am I missing something? Great module though, many thanks :)

jack's picture
posted by jack on Dec 16 2011

the url does get included - you can see by clicking on the example above the comments.
it will probably get shortened by twitter...

Matt's picture
posted by Matt on Dec 16 2011

You're right. I tried it on my test server and it works- seems it doesn't like localhost URLs, which is very odd. A cool feature for the future would be intigration with one, or many of, the URL shortener sites!

Adell Shay's picture
posted by Adell Shay on Dec 27 2011

i submitted a question, but the return email address I used does not appear to be working. Have spent many, many hours on this question, but still unable to resolve it.
Although twitter does appear to give the entire url to a particular blog in the tweet, Facebook only gives a link to the site itself when a blog is "liked" that does not include the specific node.
Would you be so kind as to help. Thank you for this marvelous, marvelous plug in!!!!!

Adell Shay's picture
posted by Adell Shay on Mar 26 2012

I am unable to see the response to my question. Am I missing how to access it, Jack? Again, I really appreciate the plug in and the time you're taking to help us with such questions. Boundless thanks and gratitude.

jack's picture
posted by jack on Mar 26 2012

Hi adell shay - glad you like the plugin. if I understand correctly, you're saying that facebook isn't being sent the whole URL?
in the code, twitter and facebook are provided with the exact same URL, so there must be something weird going on with you're environment. can you provide a link to where I can view/debug a little?

Takis's picture
posted by Takis on Dec 29 2011

Very nice module. Congratulations! But i have a question. What about if i don't want the facebook like? Let's say that i want to keep onl;y the tweet and google!

Dan's picture
posted by Dan on Jan 09 2012

Awesome little module, thank you very much!

How can I get this to work with views or panels? I usually override the output of my content types.

bharath's picture
posted by bharath on Jan 25 2012

AWESOME! dude this is the best i was exprementing with lot of things and this is the best solution, i have right now, even though a few tweaks are indeed still needed, like the tweet text that we want to use by default and also the spacing in between the buttons and also the choice to choose where to place this. But this is so cool!

x3graphics's picture
posted by x3graphics on Feb 01 2012

In one of my nodes it loads after my fb comments, but all the rest, of the same content nodes, it shows before the comments, any ideas? Awesome plugin by the way!

jack's picture
posted by jack on Mar 26 2012

sorry for the late reply. it's likely something to do with how your theme is setup.
e.g. if the $content['comments'] are output before $content['links'] in one of your node.tpl.php files

rook's picture
posted by rook on Mar 01 2012

Do you plan to add other social site buttons as well? Like Pinterest and Stumble Upon

jack's picture
posted by jack on Mar 26 2012

not at this stage... but if enough people want it, I would consider adding them in.

Norman's picture
posted by Norman on Mar 25 2012

Thanks Dude. It's work very well !

jack's picture
posted by jack on Mar 26 2012

glad you like it :-)

Colin's picture
posted by Colin on May 01 2012

I've installed the module, selected everything on the configuration page, but it doesn't appear on the Blocks (disabled) page. I also noticed that while the download link says version 7-1.5.zip, it installs 7-1.2.zip.Am I missing something obvious?

jack's picture
posted by jack on May 01 2012

Hi Colin - the buttons should show up on the nodes that you've configured. The module doesn't provide a block.

Rank Us

Rank BEACON9 with a tweet...

Got Skillz?

If you've got ninja web skillz and are interested in working with us, get in touch!

Ready to rock? Get in touch for a free consultation & quote.Get in touch

Copyright © 2012 BEACON9 Media Ltd. All Rights Reserved.

Powered by Drupal A BEACON9 Creation