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.
I'm trying to implement a feature of the AddThis facebook_like_counter so I can change the font as described on their site using fb:like:font="verdana"
as an option in the link with class="addthis_button_facebook_like"
. How would I do this and still retain the rest of the settings in admin/settings/addthis? I just need to be able to change the font of the Facebook Like button without having to install yet another module.
Comments
Comment #1
Les LimThis is a problem I'm struggling with generally in developing this module. On the one hand, AddThis has a standardized API for its core functionality, and on the other, there are special features that each have their own unique configuration patterns. The trick is to design a theme system and UI that allows for configuring special cases while remaining easy to implement for the layperson. Ideas are welcome here.
For the moment, though, there's no way to do what you're asking from the settings. You'll have to override the theme_addthis_toolbox_item in your template.php file.
Comment #2
Les LimChanged my mind on the status, and generalizing the title.
Comment #3
jacobroufa CreditAttribution: jacobroufa commentedSounds good Les! Thanks for the tip, I'll throw up a new issue tagged with the Documentation component so others can benefit from the theme_addthis_toolbox_item function you mentioned. I've also been planning on hacking around in the module, so I may have some patches for you.
I think a good solution with regards to the special cases (which at the moment mostly leans on the FB Like) is to implement an expandable section towards the bottom of the module page, for now just calling it Facebook Like and only implementing those tags, where there is a text area that allows one API call per line with a link to a page or pages on AddThis' website in the helper text above or below the section. Also another section above that for more generalized API calls geared towards AddThis' standard functionality (for things like button graphic changes, et al).
Comment #4
Les LimJacob, I created a new 3.0-beta1 release which has a new interface for making exactly the kind of customizations you were asking about. I'd love to get your opinions if you have some time to download it and see if you can get it to do what you want.
Comment #5
Les LimI'm going to mark this as "fixed" to indicate that the feature is implemented, but I'd still welcome input, either here or in a new issue.
Comment #7
jacobroufa CreditAttribution: jacobroufa commentedHey Les, I finally got some time to try this. Amazing! I'm still having one issue though, in that I'd like to be able to make a drupal API call within the customization. Specifically - this customization og:image="$node->field_image[0]['filepath']" in the HTML Attributes field. I'd like for the filepath to actually turn into a path...
According to http://developers.facebook.com/docs/reference/plugins/like/ og:image pulls an image from the page into the "liked" item on someones Facebook feed. Right now when I'm liking some of the items on the site I'm developing I get this result http://img155.imageshack.us/i/episode.png/ and on other content types that don't have a video item, I get this (expected) result http://img263.imageshack.us/i/articlem.png/ . So as you can see, I'd like to be able to use an image field to feed what is shown on Facebook.
I hope this makes sense. How would I allow this field to use php in this way?
Comment #8
jacobroufa CreditAttribution: jacobroufa commentedComment #9
Les LimI see your point, but I'm going to rule out evaluating PHP code from the interface. That's an invitation to trouble.
Initially I would think this might be addressed by token integration, although it would take some looking into. One problem is that since a toolbox can be displayed anywhere, you can't guarantee that there will be a node context from which to generate the tokens you want.
Comment #10
toemaz CreditAttribution: toemaz commentedImplement something like
to add something to or change the attribute of a service.
Comment #11
Les Limtoemaz: in this case, jacobroufa is asking for the ability to pull in contextual variables (from a node object, for example). There is no way to do that in the interface or the code, as of yet.
Comment #12
jacobroufa CreditAttribution: jacobroufa commentedToken support would be killer. That would probably be the best way to go about contextual variables... much safer than allowing PHP. Good thinking! Even though there wouldn't always be a single consistent context to pull from, I would assume site admins would at least know what they want to display where, and adjust tokens accordingly. Les, let me know what I can do to help with the Token integration. I'll be checking back here frequently. :)
I'd love to be able to do everything I need to within this one module; can't wait til this happens!! At the moment though, I'm having to use http://drupal.org/project/opengraph_meta in order to push OpenGraph data to FB, as I cannot do that within the module yet. You might recommend using this to other people, at least until token support is added.