Disqus comment count is wrong #427

Closed
flexthink opened this Issue Oct 8, 2012 · 2 comments

Projects

None yet

2 participants

@flexthink

With Disqus enabled, the comment count at the top of a blog post page shows zero comments even if there have been comments posted.

The comment count on the listing page is correct though

I was able to fix this one myself with a template customization. It would be nice to see it work out of the box though.

in blog_post_details.html:

Replace the comment count with:

    {% if blog_post.allow_comments %}
        {% if settings.COMMENTS_DISQUS_SHORTNAME %}
        <a href="{{ blog_post.get_absolute_url }}#disqus_thread"
            data-disqus-identifier="{% disqus_id_for blog_post %}">
            {% trans "Comments" %}
        </a>
        {% else %}      
            (<a href="#comments">{% spaceless %}
            {% blocktrans count blog_post.comments_count as comments_count %}1 comment{% plural %}{{ comments_count }} comments{% endblocktrans %}
            {% endspaceless %}</a>)
        {% endif %}
    {% endif %}

Also, add this at the bottom:

{% if settings.COMMENTS_DISQUS_SHORTNAME %}
{% include "generic/includes/disqus_counts.html" %}
{% endif %}
Owner

Thanks for working this out. Could you set up a pull request? Would be happy to merge it in.

@stephenmcd stephenmcd pushed a commit that closed this issue Oct 11, 2012
cato Fixes #427: Disqus comment counts are now pulled in on the blog post …
…detail page, if available.
540e52b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment