【问题标题】:Facebook comments plugin on multiple pages?多个页面上的 Facebook 评论插件?
【发布时间】:2020-05-12 10:43:09
【问题描述】:

我有一个包含多个页面的网站。这是一个与新闻相关的网站,它生成具有唯一 URL 的文章页面,例如 http://localhost:5000/results/167http://localhost:5000/results/168。我想使用Facebook comments plugin,但我不知道如何让它保持不同页面上的 cmets 分开 --- 无论某人在哪个页面上,它们都只是集中在一起。我该怎么办?

几年前有人asked this,但我无法理解答案-他们说“为每篇文章设置唯一的xid”,我不确定这意味着什么(我是新手)。

非常感谢!我的 HTML 代码如下。

<!DOCTYPE html>
<html>
<head>
<title>Results</title>
</head>
<body>
<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v5.0&appId=1560520617436290&autoLogAppEvents=1"></script>

<div class="fb-comments" data-href="http://localhost:5000/results/" data-width="" data-numposts="5"></div>
<br>
    <div class="voteorresult"><a href="/votefor/{{ 'id' }}">Vote</a></div>
<a href="/">
    <div class="home">
        Investigate more articles
    </div>
</a>
</body>
</html>

【问题讨论】:

    标签: html facebook plugins comments


    【解决方案1】:

    没关系,让它工作!我在 URL 中添加了 jinja:

    <div class="fb-comments" data-href="http://localhost:5000/results/{{ id }}" data-width="" data-numposts="5"></div>
    

    【讨论】:

      猜你喜欢
      • 2012-02-10
      • 2013-08-14
      • 2011-12-12
      • 2011-11-13
      • 1970-01-01
      • 2011-06-14
      • 1970-01-01
      • 1970-01-01
      • 2018-11-17
      相关资源
      最近更新 更多