[SOLVED] Disqus - Comment Count
This is an open discussion with 3 replies, filed under XSLT.
Search
Sadly, not a Symphony thing, but a Disqus API thing.
http://help.disqus.com/customer/portal/articles/565624-tightening-your-disqus-integration
http://help.disqus.com/customer/portal/articles/1131783-tutorial-get-comment-counts-with-the-api
I did this a while ago. As far as I can remember there are 3 steps involved.
- In your blog.xsl, include some Disqus javascript that will load the disqus comment counter code. See the attachment to this post for mine.
Include a javascript variable definition in the article page (in your case, blog-post.xsl). It gives Disqus the identifier for your post and will allow you to get the comment count for this identifer in the main page. This is mine (simplified the XSLT):
var disqus_identifier = 'articulo-<xsl:value-of select="@id"/>
Include a special tag in the place where you want the comments to appear. I did it as a hyperlink which, in your case, would lead to the comments in blog-post.xsl
<a href="{$root}/articulo/{titulo/@handle}#disqus_thread" data-disqus-identifier="articulo-{@id}">Comentarios</a>
Disqus links the comments in the article to the comment count in the main page via the data-disqus-identifier tag, which corresponds to the disqus_identifier variable in the blog_post page. Hope this helps.
Thanks for your help guys :)
Create an account or sign in to comment.
I've installed Disqus on my blog. Everything is working but I want to display comment count on my blog main page.
Comments are displaying in
blog_post.xsl
, and comment count should display onblog.xsl
.E.g.
I've 2 comments in first entry. On main page I'd like to have something like this:
2 Comments
.When a new comment is added I'd like to display how many new comments are added.