When using langauges different from english in the client browser, the "Like" string is translated in a longer one by AddThis.
The string may hide the FB counter.
AddThis.com Support suggested to add the following style:

<a class="addthis_button_facebook_like" fb:like:layout="button_count" fb:like:width="150"></a>

but it is not clear to me where this should be patched in the Drupal AddThis module.
any idea?

Many thanks for your work.

CommentFileSizeAuthor
#9 Customize services50.62 KBknalstaaf

Comments

Treidge’s picture

Try this: go to admin/settings/addthis/custom, open collapsed field called "Add a service customization", and fill the form with following details ( from top to bottom ).

Service code:
facebook

HTML classes: <----- not sure if this one is necesarry
addthis_button_facebook_like

HTML attributes: <----- this one is what you're looking for
fb:like:width="150"

This should help, I think.

les lim’s picture

Treidge has the right idea. A few notes:

1) I think univac would be trying to redefine the "facebook_like" service code, so that's what should be used in the service customization.
2) The HTML class is definitely necessary when doing a custom service.
3) In order to generate the HTML exactly from the example, the HTML attributes should be like this:
fb:like:layout="button_count" fb:like:width="150"

BrockBoland’s picture

I'm seeing the same issue. The count is available in the DOM within an iframe, but has a CSS class that's hiding it.

Before I realized there was a Customize Services tab I used the alter hook to implement the same solution (I think I'm looking at the same thread as univac: http://www.addthis.com/forum/viewtopic.php?f=3&t=29733):

function mymodule_addthis_toolbox_services_alter(&$services) {
  if ($services['facebook_like_counter']) {
    $services['facebook_like_counter']['attributes'] = 'fb:like:layout="button_count" fb:like:width="150"';
  }
}

This is outputting that fb:like:width attribute correctly, and it does use that width for the iframe, but the like count td still has the hidden_elem class that has the display:none property on it.

I also compared the output from the facebook_like_counter and facebook_like options and they seem to be the same: facebook_like_counter just adds an attribute (fb:like:layout="button_count"), but according to the an AddThis employee (second comment here: http://www.addthis.com/forum/viewtopic.php?f=5&t=26854) that's the default layout anyway.

I'm not sure if this is an issue with this module or with the AddThis API.

Frederic wbase’s picture

Bumping, i have the same problem. Changing the width of the button to 150px with the custom service doesen't fix it. Does any one has a real solution for this?

Since the widget translates the string on the button, wouldn't it be better to give the button a flexible width, calculated on the size of the string?

kenzol’s picture

Does anyone know something new concerning this issue?

Frederic wbase’s picture

Well, for me the problem seems to be fixed. From the moment that the likke button is clicked for the first time the counter apears

knalstaaf’s picture

Not for me it isn't :)

Tried all of the above to no avail so far.

knalstaaf’s picture

Version: 6.x-3.0-beta1 » 6.x-3.0-beta2
knalstaaf’s picture

Status: Active » Closed (fixed)
StatusFileSize
new50.62 KB

Ok, found the solution:

I went to admin/settings/addthis/custom, and filled out the following fields:

  • Service code: facebook_like
  • HTML classes: addthis_button_facebook_like
  • HTML attributes: fb:like:width="150"

(See attachment)

Pretty much what's being described above.