I've installed the AddThis module and am trying to print the buttons on my template, however I can't get it to work. Here's the I'm using:

$addblock = module_invoke('addthis','block_view','addthis_block');
print render($addblock['content']);

For the record, If I switch to Bootstrap theme, the links are displayed on the page, if I switch to my own theme (Bootstrap child-theme) it doesn't. I've copied the code verbatim from modules/node/node.tpl.php and it still doesn't work.

Any suggestions?

  • Is there any particular reason you don't want to do it in a classic way? Why don't you print region in your theme, and put that block in it using blocks configuration GUI? You know, the way it was designed to work? – Mołot Jul 13 '15 at 16:08
  • And how is the classic way? Using the module? – WagnerMatosUK Jul 13 '15 at 16:16
  • Classic way is to print region in theme, and then go to admin->blocks and assign that block to a region. – Mołot Jul 13 '15 at 16:19
  • Ah, ok I got you mean, in this it wouldn't work for me as I'd like to have more control over the location of the buttons than this approach would allow me. Unless I create a specific region for each content type (which I'd rather not do). – WagnerMatosUK Jul 13 '15 at 17:08
  • But you can have one region and only output it differently per content type. – Mołot Jul 13 '15 at 17:12

did you enable the Display Setting in your addthis block configuration because code is good go it working for me, so go and configure the display setting surely it will work.. its under admin/structure/block/manage/addthis/addthis_block/configure enable it as you need by "Basic button or Basic Toolbar"...

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.