Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disqus_identifier not being set #78

Open
int-ua opened this issue May 15, 2017 · 7 comments
Open

disqus_identifier not being set #78

int-ua opened this issue May 15, 2017 · 7 comments

Comments

@int-ua
Copy link

int-ua commented May 15, 2017

Update/Resolution: In case {% with %} is used {% disqus_show_comments %} must be placed before the closing {% endwith %}. Looks like it's worth a mention in the docs. Close it if you think otherwise.

Older comment:
This line does nothing:

Django 1.8.18
django-disqus 0.5
Python 3.4

I've set it up long ago and didn't check it. It was working without this config. At least we thought it was until we found out that comments are published on wrong pages and wrong links were formed by Disqus.

@int-ua
Copy link
Author

int-ua commented May 15, 2017

With this code it outputs only disqus_url:

{% with item|model_name as disqus_prefix %}
{% with item.id|stringformat:"s" as item_id %}
	{% set_disqus_identifier disqus_prefix "_" item_id %}
{% endwith %}
{% endwith %}

{% set_disqus_url request.build_absolute_uri %}

@int-ua int-ua changed the title config variable not shown at all disqus_identifier not being set May 15, 2017
@int-ua
Copy link
Author

int-ua commented May 15, 2017

It is being set in set_disqus_identifier() but it's somehow no longer present in get_config()

@int-ua
Copy link
Author

int-ua commented May 15, 2017

Found it. In case {% with %} is used {% disqus_show_comments %} must be placed before the closing {% endwith %}.

@SalahAdDin
Copy link

SalahAdDin commented May 21, 2017

@int-ua Did you solve your problem?

Solition/acclaration must be putted in documentation.

@int-ua
Copy link
Author

int-ua commented May 22, 2017

Yes, it should, but I'm not sure how to phrase it better, I'd like someone else doing it.

@SalahAdDin
Copy link

SalahAdDin commented May 22, 2017

Let me see the documentation about it.

@int-ua Can you put here the final code?

And, can you sahre with me your user case? You are trying a list of post with number comments, aren you? Interesting.

I used the next code:

<div id="fb-root">
        <!-- TODO: Review this with documentation -->
        {% set_disqus_identifier self.slug %}
        {% set_disqus_title self.title %}
        {% set_disqus_url self.full_url %}
        {% disqus_dev %}
        {% disqus_show_comments %}
    </div>

Is the normal use, for this reason there aren't other notes about other alternatives about how use it.

@int-ua
Copy link
Author

int-ua commented Jul 14, 2017

My final code:

	{% with item|model_name as disqus_prefix %}
	{% with item.id|stringformat:"s" as item_id %}
		{% set_disqus_identifier disqus_prefix "_" item_id %}
		{% set_disqus_url request.build_absolute_uri %}
		{% disqus_show_comments %}
	{% endwith %}
	{% endwith %}

And I still get all comments on one page but that's another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants