Sitefinity 的 Disqus

Disqus for Sitefinity

我正在尝试找出以下情况的最佳解决方案。

我在主页和存档页面上展示了我的文章。主页 Url 结构与存档页面不同,我认为这就是混乱的来源。当访问者在主页上对文章发表评论时,该评论不会显示在存档页面中的文章上,反之亦然。

这是首页文章Url的结构:

domain.com/portal/home/full-article/article-title/

这是存档页面上的 Url 结构:

domain.com/portal/archives/full-article/article-title/

这是来自 Disqus 的 JavaScript 代码:

<div id="disqus_thread"></div>
        <script>
            /*var disqus_config = function () {
                this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
                this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
            };*/
            (function() { // DON'T EDIT BELOW THIS LINE
                var d = document, s = d.createElement('script');                
                s.src = '//short-name.disqus.com/embed.js';             
                s.setAttribute('data-timestamp', +new Date());
                (d.head || d.body).appendChild(s);
            })();
        </script>
        <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>

我想让评论同步显示在主页和存档页面上。截至目前,评论的显示方式因访问者选择发表评论的页面而异。

我阅读了文档,但不确定是否取消注释 this.page.urlthis.page.identifier帮助解决这种情况。如果是,我应该在 Sitefinity 中使用什么值?

标识符设置 Disqus 线程。

https://help.disqus.com/customer/portal/articles/472095-how-do-i-load-the-same-thread-of-comments-on-multiple-pages-

您需要确保将标识符值设置为唯一的值,在您的情况下为文章。

如果缺少标识符,则使用 url

在此处阅读更多内容: https://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables