画布应用中的 Facebook 评论插件:访客墙上的评论看起来很丑

发布于 2024-12-21 11:49:41 字数 1237 浏览 2 评论 0原文

我想在页面选项卡/画布页面的底部放置一个评论框,以便访问者可以发布将显示在该页面上的评论,并且 - 如果用户选中该复选框 - 在访问者的墙上。我使用评论插件来做到这一点

<div class="fb-comments" data-href="[link to real url of this page]" data-num-posts="2" data-width="520"></div>

评论在评论框中看起来不错。该评论在访客墙上看起来很难看。访客墙上的评论似乎收集了评论框页面的元标记信息。我已经根据 http://developers.facebook.com/docs/opengraph/ 并通过 facebook linter 测试了设置 http://developers.facebook.com/tools/debug< /a> 取得了良好的结果。现在,访客墙上的评论看起来不错,但有一些小问题:

  1. 评论没有链接到 facebook-url (http://www.facebook.com/pages/..),而是链接到页面的真实 url (http ://www.somewhere.com/page-with-comments.php)这是不希望的,
  2. 评论包含指向真实网址的链接,这根本不是所希望的

对于(2),我在生成在访客墙上发帖,作者:

FB.api('/me/feed', 'post', { picture: pic, caption: ' ', description: desc, link: link }, function(response) {});

but那么可以通过设置一个空白的标题属性来避免链接。不幸的是,facebook linter 似乎不喜欢这个属性(og:caption)。对于(1),我不知道如何解决这个问题,因为 linter 不喜欢元标记 og:url 中的任何 facebook-url,而另一方面,它负责访问者墙上评论的链接目标。这不好。

长话短说,如何在页面选项卡/画布页面上实现评论插件,并在访问者墙上提供漂亮的评论外观,并在评论处提供指向页面选项卡/画布页面的链接。

多谢

i want to place a comment box at the bottom of a page tab/canvas page so that visitors can post comments that will be shown on that page and - if the user checks the checkbox - at the visitor's wall. I do this with the comments plugin

<div class="fb-comments" data-href="[link to real url of this page]" data-num-posts="2" data-width="520"></div>

The comment looks nice in the comments box. The comment looks ugly at the visitor's wall. The comment at the visitor's wall seems to gather the meta tag information of the comments box page. I have customized the meta tags according to http://developers.facebook.com/docs/opengraph/ and tested the setting by the facebook linter at http://developers.facebook.com/tools/debug with a good result. Now the comment at the visitor's wall looks fine with some small problems:

  1. the comment does not link to the facebook-url (http://www.facebook.com/pages/..) but to the real url of the page (http://www.somewhere.com/page-with-comments.php) which is not desired
  2. the comment contains a link pointing to the real url, which is not desired at all

For (2) i had a similiar problem when generating a post at the visitor's wall by

FB.api('/me/feed', 'post', { picture: pic, caption: ' ', description: desc, link: link }, function(response) {});

but then the link could be avoided by setting a caption attribute of one empty space. Unfortunately this attribute (og:caption) seems not be liked by the facebook linter. For (1) i have no idea how to solve the problem as the linter does not like any facebook-urls in the meta tag og:url, which on the other hand is responsable for the link target of the comment at the visitor's wall. This is not good.

Long message short, how do you implement the comments plugin on a page tab/canvas page with a nice look of the comment at the visitor's wall and a link at the comment to the page tab/canvas page.

Thanks a lot

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七分※倦醒 2024-12-28 11:49:41

为了获得您正在寻找的内容,您必须将 Open Graph 元标记添加到您在 fb-comments div 中用作 href 的页面。

支持的标签的描述如下: http://developers.facebook.com/docs/share/< /a>

您可以使用此处的调试器工具检查 facebook scraper 在阅读您的页面时看到的内容:
http://developers.facebook.com/tools/debug

In order to obtain what you are looking for, you have to add the Open Graph meta tags to the page that you're using as href in the fb-comments div.

The description of the supported tags is here: http://developers.facebook.com/docs/share/

You can check what the facebook scraper sees when reading your page by using the debugger tool here:
http://developers.facebook.com/tools/debug

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文