开发者

Is it possible to define different open graph parameters for more than one blog post on a page?

I am building the front end of a blog. The page I'm currently working on - which has about 6 different blog posts previewed - requires that the user be able to share the blog post landing page via Facebook using addThis. Is it possible to define different open graph parameters for more than one blog post on a page? I know the tags are added to the as metadata, but I wasn't able to find any info on how to define a different url other than the current page url within the share link. I am using this:

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a c开发者_高级运维lass="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xxxxxx"></script>
<!-- AddThis Button END -->

...and these are the attributes offered by addThis to define custom params:

<a href="http://www.addthis.com/bookmark.php" 
      class="addthis_button"
      addthis:url="http://example.com"
      addthis:title="An Example Title"
      addthis:description="An Example Description">
</a>

The problem is that I can't seem to get this to work for FB. These are sample open graph tags that are (theoreticall) defined in the

<meta property="og:title" content="Title Here" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://www.BlogPost.com/post1" />
<meta property="og:image" content="http://www.BlogPost.com/image1.jpg" />
<meta property="og:site_name" content="http://www.BlogPost.com" />

The FB share links keep picking these up instead of the custom info... and I can't omit this because I need it for the page level share link. Adding the attributes works for the twitter button, btw... just not the FB one.

I'd appreciate any insight into how to do this or whether or not it can be done...

Thanks!


I think it's one object per page. If the landing page has multiple entries, maybe create your object based around that premise, that its either a full site or a site of articles tagged "programming" or something.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜