Extension, Plugin

Archived
Forum
(read-only)

EE ShareThis

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Protean Web

     

Facebook API Not Honoring Summary Parameter?

Support Request

imnotshelley
imnotshelley

Hi,

I’m using the plugin to create three individual share buttons in a news slider (snippet), which pulls content from multiple channels. I have the summary parameter set to a custom field in EE:

<div id="share_links">
{if channel_short_name == "news"}
{exp
:sharethis:button service="facebook" text="Facebook" title="{display_title}" summary="{article_body_copy}" url="{title_permalink="news/index"}" image="{article_banner_img}"}
{exp
:sharethis:button service="twitter" text="Tweet" title="{display_title}" summary="{article_body_copy}" url="{title_permalink="news/index"}" image="{article_banner_img}"}
{exp
:sharethis:button service="email" text="Email" title="{display_title}" summary="{article_body_copy}" url="{title_permalink="news/index"}" image="{article_banner_img}"}
{
/if}
</div>

<
div id="share_links">
{exp:sharethis:button service="facebook" text="Facebook" title="{title}" summary="{prod_intro}" url="{site_url}products/overview/{url_title}" image="{prod_banner_img}"}
{exp
:sharethis:button service="twitter" text="Tweet" title="{title}" summary="{prod_intro}" url="{site_url}products/overview/{url_title}" image="{prod_banner_img}"}
{exp
:sharethis:button service="email" text="Email" title="{title}" summary="{prod_intro}" url="{site_url}products/overview/{url_title}" image="{prod_banner_img}"}
</div

I wanted to avoid using the OpenGraph description metadata since the entries are in three different channels, which pull the summaries from different custom fields. And obviously the slider rotates, so the value of the og:desc should change.

Both the Twitter and Email buttons honor the Summary parameter without including the OpenGraph metadata, but Facebook will not. It just seems to be ignoring it altogether. I’m wondering if this is an issue with the Facebook API or an issue with the plugin.

If it’s just the API, then how would one even use multiple instances of the a Facebook share button on the same page? Would this have to be handled with jQuery or something? Thanks!

jayalfredprufrock
# 1
Developer
jayalfredprufrock

Hello, unfortunately you are right: this is an issue with the Facebook API. Facebook likes to have complete control over content generation, and so besides using OpenGraph tags, there is presently no way to force Facebook to use a specific summary. I originally thought this could easily be overcome with javascript, but unfortunately my preliminary tests were unsuccessful. Facebook makes its own page request to the url where the Like button lives, and doesn’t look up the opengraph tags via javascript when the Like button is clicked. This means that there needs to be a unique url that populates the opengraph tags according to the content that you’d like to share (perhaps using query strings??) making a pure javascript solution to this problem likely impossible. I still have one idea left to try, but having been defeated more than once by the Facebook API, I’m not particularly hopeful. I feel like if an easy solution existed, the people over at ShareThis would have rolled some kind of feature into their own API. I know its possible to get multiple Like buttons on a single page by bypassing ShareThis altogether, so if it doesn’t prove too difficult, I might work such a feature in to my plugin, but then again, it starts to move away from the original goal of this plugin: to provide a simple interface to manage ShareThis. Hope this helps, and please let me know if you have any ideas or discover anything I’m not aware of. Good luck!