You need to sign in or sign up before continuing.
Usage of data-custom-text returns : "commentsText is not a function"
I want to add some custom text to Commento. Checked documentation and added this into Ghost backend :
<script>
window.commentCustomText = function(count) {
if(count === 0) {
return "No comments";
} else if (count === 1) {
return "1 comment";
} else {
return count + " comments";
}
}
</script>
<script src="https://cdn.commento.io/js/count.js" data-custom-text="window.commentoCustomText"></script>
At page loads, console logs returns : "commentsText is not a function" seems to be this part :
t.commentCounts&&(n=t.commentCounts[o[e]]),a[e].innerText=commentsText(n)}else console.log("[commento] error: "+t.message)})}
And this is the block that displays my posts with comments :
<div class="meta">
{{#primary_author}}
<a href="{{url}}" class="author-meta" title="{{name}}">
{{#if profile_image}}
<span class="author-image cover" style="background-image: url( {{img_url profile_image size="avatar_thumb"}} );"></span>
{{/if}}
<span class="author-name">{{name}}</span>
</a>
{{/primary_author}}
<a href="{{url}}#commento" class="comments meta-info alignright"><i class="remixicon remixicon-chat-2-line"></i> <span class="disqus-comment-count" data-disqus-url="{{@site.url}}{{url}}" data-disqus-identifier="{{comment_id}}">0</span></a>
<div class="clear"></div>
</div>