Repository navigation
#23 Disqus add comment count - #24
Conversation
bdunogier
left a comment
There was a problem hiding this comment.
A couple grammar issues, but that aside, +1.
|
|
||
| #### Add comment count | ||
|
|
||
| This bundle handle the js loading to count disqus comments, all you have to do is to add an element with "disqus-comment-count" class |
| #### Add comment count | ||
|
|
||
| This bundle handle the js loading to count disqus comments, all you have to do is to add an element with "disqus-comment-count" class | ||
| as it is detailled in [disqus documentation](https://help.disqus.com/customer/portal/articles/565624-adding-comment-count-links-to-your-home-page). |
| dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; | ||
| (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | ||
| })(); | ||
| (function() { |
There was a problem hiding this comment.
Unfortunately this makes extra request even if user do not want to use counter feature.
Maybe would be better to move it to configuration?
There was a problem hiding this comment.
we could also improve this part:
var disqus_create = function(path) {
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = path;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}
disqus_create('//' + disqus_shortname + '.disqus.com/embed.js');
disqus_create('//' + disqus_shortname + '.disqus.com/count.js');There was a problem hiding this comment.
From my point of view, I prefer having the same code as the one recommended by the provider it make maintenance easier
There was a problem hiding this comment.
@clash82 about the configuration, this is what I discuss with @bdunogier as counting is nearly a must have function in a list and especially in comment where this means popularity we ends on shipping that together
There was a problem hiding this comment.
If @bdunogier wants it like that then I'm fine :) it's just that there are different use cases, sometimes you want to have a counter and sometimes not. Would be great to have a complex solution but not required.
There was a problem hiding this comment.
I don't disagree with you, as a matter of fact, @clash82. We could easily add an option to the twig functions to enable/disable comments count.
I guess that the default value for this option should be disabled, since it wasn't there before.
Could you give it a try and let us know, @nicolas-bastien ?
|
@bdunogier up to you |
|
After discussion, let's put this topic on hold for the time being. |
|
@nicolas-bastien you can rebase when it fits you so we can get travis to run stuff again. |
b76e772 to
3374d6b
Compare
|
@bdunogier @clash82 so here is the configuration for count |
|
|
||
| #### Add comment count | ||
|
|
||
| This bundle handles the js loading to count disqus comments, all you have to do is : |
There was a problem hiding this comment.
Not bad, just a suggestion that we could add some context to describe what will happen if you enable this feature. Something like:
This bundle supports additional Disqus comments counter which is loaded in separate JavaScript file. This counter is disabled by default and if you want to enable it, you have to follow these steps:
0b68bdc to
db6c894
Compare
|
Could you please update the pull-request's description ? |
|
Looks good to me besides that. |
Fix #23
Description
This PR adds an new configuration 'count' for disqus provider, which allow to load js comment counter code.
Test
Manually on Ez demo post view page
Link to https://jira.ez.no/browse/DEMO-35