Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#3 | Add Block.png | 54.03 KB | ccheu |
#3 | Enable Block.png | 19.01 KB | ccheu |
addthis.png | 10.04 KB | ccheu |
Comments
Comment #1
ccheu CreditAttribution: ccheu commentedI 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. :)
Comment #2
c-c-m CreditAttribution: c-c-m commentedI 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.
Comment #3
ccheu CreditAttribution: ccheu commentedIdeally 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!
Comment #4
bmateus CreditAttribution: bmateus commentedI'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.
Comment #5
Abelito CreditAttribution: Abelito commentedIf 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
Comment #6
matglas86 CreditAttribution: matglas86 commentedIn 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.
Comment #7
gisleThis feature is also requested in #1515424: Ability to change main "button" image, so I am closing this as a duplicate.