On the AddThis website, you can choose your own button, under the "Select your style" section.
http://www.addthis.com/web-button-select

When you press "Get the Code" button, you are presented with a code.

How do I get this code into the setup so that the AddThis module takes this code as the style I want to use? I've attached the style I want to use.

I want to display the AddThis at the bottom of my custom content type.

Please advise. Many thanks!

Regards,
Chang

CommentFileSizeAuthor
#3 Add Block.png54.03 KBccheu
#3 Enable Block.png19.01 KBccheu
addthis.png10.04 KBccheu
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ccheu’s picture

Status: Active » Closed (fixed)

I just had an idea. I created a Block, set the body to Full HTML, pasted the code generated from AddThis into the body of the block, then set the visibility settings for content type. Put the Block in the region I want, and viola! Job done! Hope this helps others. :)

c-c-m’s picture

Status: Closed (fixed) » Active

I also want to display this button: http://drupal.org/files/issues/addthis.png (facebook likes and retweets only)
but I didn't manage to understand how to change widget type, si I also tried the same solution as #1. Unfortunately I can't place the block under the body field and over the comments, since there's no region there.

Additionally, if the solution is that one, I don't see the need of this module.

ccheu’s picture

FileSize
19.01 KB
54.03 KB

Ideally the module should have the ability to take the button code as provided by AddThis, but I believe this is still being developed. I'm doing this as a workaround for the time being, not to negate the good work of the developers. :)

Let me just outline step by step what I did. It's pretty simple.
1. Create a Block (admin/structure/block/add)
2. Set the body to use "Full HTML" (See" Add Block.png")
3. Go to http://www.addthis.com/web-button-select and choose your button style. Generate and copy the code.
4. Pasted the code into the body of the block (See" Add Block.png")
5. If you want the AddThis to appear for only certain content types, remember to set the visibility settings by clicking on "configure" under Operations column of block list/table.
6. After you have created your block, enable it in the region you want. (See" Enable Block.png")

Hope this helps. Good luck!

bmateus’s picture

I've actually done a completely different thing.
I've opened the addthis.module file (usually this sits inside the sites/all/modules/addthis folder) in a text editor, and on line #152 you can see a comment saying /* Theme the AddThis button .

I've left the code untouched until line #170. Right after the return ( sprintf(' , I saw some html code. I copied the html code from Addthis.com button over this html (be careful to delete just the html - usually between <div> and </div>, not the rest of the php arguments), and voila, I had the custom Addthis in each post.

Still not so cool, tough. If the page shows several teasers (with each related set of buttons), the code seems to be the same, always relating to the first post displayed.

Hope it helps.

Abelito’s picture

Version: 7.x-2.x-dev » 7.x-4.x-dev

If you want to use this module hack and you just want to change the images to 32px images, you can just add "'addthis_32x32_style'," on line 28 of "addthis_displays/addthis_displays.addthis.inc"

Cheers

matglas86’s picture

In would not recommend to hack the module. This module is not meant to past in your 'Get Your Code' from addthis.com. It meant to configure your buttons. This might be a feature in the future but not now.

But to help you along. You should configure a Toolbox display on a field or in a block and add the desired services too it in the configuration. You can find the service names as the last part after addthis_button_*. Please copy these service names and past them in to the services box on the configuration page for your field or block.

I hope that helps.

gisle’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)
Parent issue: » #1515424: Ability to change main "button" image

This feature is also requested in #1515424: Ability to change main "button" image, so I am closing this as a duplicate.