Closed (fixed)
Project:
AddThis
Version:
7.x-4.x-dev
Component:
Documentation
Priority:
Critical
Category:
Feature request
Assigned:
Reporter:
Created:
8 Dec 2011 at 12:15 UTC
Updated:
28 Jan 2014 at 16:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
snoopy77 commentedI also have the same problem !
Comment #2
matglas86 commentedHi guys,
Please see my comment here http://drupal.org/node/1363682#comment-5336398 as it is about the same thing. Try it and I hope it helps. If not let me know.
Comment #3
Bakkon commentedThanks for the quick reply!
I'm just getting familiar with building or modifying modules, so could you help me where do I find the parameters for $options? It took me 2-3 hours only to modify the button size to 32x32, so it would be much faster:)
Thanks
Comment #4
matglas86 commentedWhen you look here (addthis_displays/addthis_displays.field.inc) you'll see the code for the two basic display types that there are. Starting on
line 12you will see the setting parameters. The $options parameter will contain the settings that you can alter. Here is the reference to the settings.$options['#display']['settings'].So you can do for example
note I did not test this code but it should be almost like this ;)
In this file (addthis_displays/addthis_displays.addthis.inc) you see the rendering of the toolbox and how the options are used.
You can also alter the markup render array like this.
Comment #5
frixos12 commentedHi matlas
and thank you for your posts.
I have tried the above code but i get a warning message :Undefined index in type.
I removed $options['#display']['type'] == 'addthis_basic_toolbox' condition but nothing really changed.
Have you tested this code yourself?
Thank you.
Comment #6
matglas86 commentedIf you know how to use dpm() from the devel module you could run some debugging yourself. A index that is not available should not be to hard fix. I have not tested the code I typed it out of what I know.
Comment #7
matglas86 commentedI found a issue in the code because type was not added as was supposed to. Therefore here is a fix.
And the alter code is like this.
I hope you can test this patch.
Comment #8
matglas86 commentedPatch applied to the master and dev branch for 7.x-4.x
Comment #10
waaadim commentedhi, i've tried your code snippet but my block still shows only facebook and twitter.
Comment #11
joshicsinHere is the solution for 7.x:
1) Open file addthis_displays.field.inc and do following modifications:
2) Open addthis_displays.addthis.inc and do following on line #30
This should fix the issue.
Thank you.
Comment #12
ruthverena75 commentedhi matglas, thanks for taking care of this issue.
i use the dev branch for 7.x-4.x and i get only facebook and twitter in the block toolbox.
an when i apply the modifications mentioned in #11 i get no more services at all and a warning
Warning: implode() [function.implode]: Invalid arguments passed in addthis_displays_addthis_display_markup__addthis_basic_toolbox() (Zeile 30 von […]/sites/all/modules/addthis/addthis_displays/addthis_displays.addthis.inc).Comment #13
chris-cmfi commentedI get the same error as #12 following this last solution.
Comment #14
ruthverena75 commentedhelp? anybody?
Comment #15
ruthverena75 commentedComment #16
Bakkon commentedHi!
I hardcoded it in the end, I wouldn't recommend that, because you loose it when you upgrade the module, but it was good for my purposes.
This is for 7.x-4.x-dev. In the addthis/addthis_displays/addthis_displays.field.inc file starting from line 9 you find
If you edit the shared_services you can add the one you need.
Once again it would be cleaner with hook_field_formatter_info() but that time i didn't understand a thing about hooks:P
Hope this helps until a more elegant solution is out.
Comment #17
bryancasler commentedSame problem with the current dev. Renders the modules unusable.
Comment #18
filnug commentedThe solution #16 from Bakkon worked for me.
But it s sure this is not the best way to work with this module...
Comment #19
matglas86 commentedPlease take a look at my example module here. Or download a example module from github (ZIP).
This example show exactly how to work with this.
For your information I am working on a solution to have the same way of configuration as on the fields to be available on the block page. This is a little more difficult to implement unfortunately.
I hope this example helps you all.
Comment #21
bharathkumarkn commentedEven I had the same problem..
I Just configured it in content type "Manage Display" settings. There r 3 display settings under "Manage Display", 1) Default, 2) full content, 3) Teaser.
Configure addthis display and include comma separated list of services for your toolbox in "full content" view not in "default" view. That's all.
It works in 7.x-4.0-alpha1.
Comment #22
knalstaaf commentedThis is not fixed yet, or is it? (I'm still having the very issue)
Comment #23
g35nightrider commentedI'm still having the same issue. But hacked it using #16's solution, which I will lose on Module update. I had to manually fill in the services block in the addthis_dispalys.field.inc. I can't even use this module out of the box.
'settings' => array(
'share_services' => 'stumbleupon,twitter,facebook, pinterest, google_plusone',
'buttons_size' => 'addthis_32x32_style',
'counter_orientation' => 'horizontal',
'extra_css' => '',
Comment #24
jackhutton commentedIt seems the contentype field 'addthis' is configurable .. I'm able to add various services.
The block 'addthis' only displays twitter & facebook .. It'd be great to have the same configuration options with the block as you do with a display type.
Comment #25
matglas86 commentedThere was another issue abou the same thing. I created the patch for it. Please review that one.
#1694868: Block only uses defaults from Display type Toolbox - can't add services like you can on content type
Comment #26
matglas86 commentedReview the issue I mentioned in the comment before.
Comment #27
matglas86 commentedIf I don't receive feedback on the issue i mentioned before in the coming week I'm going to apply that patch and close this issue. If you have any feedback please post it in the other issue.
Comment #28
matglas86 commentedFixed. See parent issue.