简体   繁体   English

ExpressionEngine条目中的Facebook“赞”按钮无法正常工作

[英]Facebook “Like” button in ExpressionEngine entries no working correctly

I am building a News section for a client website (in ExpressionEngine) and they have requested that each article have the Facebook like button. 我正在为客户网站(在ExpressionEngine中)构建“新闻”部分,他们要求每篇文章都具有“ Facebook赞”按钮。 So I went to Facebook's developer site and found the necessary code to make it work. 因此,我访问了Facebook的开发人员站点,并找到了使其正常工作所需的代码。

The problem I have is that if I like one article, it counts that like for all of them! 我的问题是,如果我喜欢一篇文章,那么对所有文章来说都一样! I'm using my ee tags for title and permalink in the OpenGraph meta tags, but to no avail. 我将ee标签用于OpenGraph meta标签中的标题和永久链接,但无济于事。

Open graph code: 打开图形代码:

{exp:weblog:entries weblog="news" orderby="date" sort="desc" limit="1" disable="member_data|trackbacks"}
    <meta property="og:title" content="{title}" />
    <meta property="og:type" content="non_profit" />
    <meta property="og:url" content="{title_permalink=news/article}" />
    <meta property="og:image" content="http://dallascityhomes.net/_images/dch-logo-big.png" />
    <meta property="og:site_name" content="Dallas City Homes" />
    <meta property="fb:admins" content="--removed--" />
{/exp:weblog:entries}

The actual button (it is wrapped within a exp:weblog:entry tag): 实际的按钮(包装在exp:weblog:entry标记内):

                <div>
                    <a href="http://twitter.com/share?text={title}" class="twitter-share-button">Tweet</a>
                    <fb:like href="{title_permalink=news/article}" layout="button_count" show_faces="false" width="80" font="arial"></fb:like>
                </div>

And of course the JS script for FB like, I moved to the bottom of the doc: 当然,像FB的JS脚本一样,我移至文档的底部:

<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>

Has anyone encountered this before? 有人遇到过吗? Know a solution? 知道解决方案吗?

查看源代码时,fb:like标记的og:url元属性和href属性是否正确呈现?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM