Page 1 of 1
Disqus module
Posted: Sun Jun 11, 2017 9:04 pm
by wmdvanzyl
Does anybody know whether the Disqus module can be adapted to 2.x?
I don't think it's working correctly anymore. My site shortname is not getting inserted. Used to work just fine before upgrade to 2.x
Re: Disqus module
Posted: Mon Jun 12, 2017 2:12 pm
by wmdvanzyl
Since this seems to be a dead fish, i think i want to try. I haven't done module development before, but there's a first time for everything. I know there's a doc on here somewhere that i will start with.
Is it possible to continue with the current Module or should i do a new one?
Re: Disqus module
Posted: Mon Jun 12, 2017 2:50 pm
by calguy1000
For people experienced with module development, with few exceptions converting a module to be compatible with 2.x is a minor task (usually an hour or two). It mostly involves testing, watching for errors and changing a few lines. or globally changing all occurrences of a certain error.
But with plugins that talk to third party services another difficulty may have crept in. The service API may have changed. So you will have to familiarize yourself with that third party API.
If you can contact the author and gain his permission he may allow you to take over the module. Otherwise, if you want to share your new module in the forge you will need to fork it or start new.
Re: Disqus module
Posted: Mon Jun 12, 2017 4:25 pm
by Rolf
I installed the Disqus module 2.1.0 in CMSMS 2.2 and it looks like working for me...
Re: Disqus module
Posted: Tue Jun 13, 2017 4:44 pm
by wmdvanzyl
Rolf wrote:I installed the Disqus module 2.1.0 in CMSMS 2.2 and it looks like working for me...
Code copied from Disqus website directly into templates (taken from source view of website):
Code: Select all
<div id="disqus_thread"></div>
<__script__>
var disqus_config = function () {
this.page.url = "https://modh.co.za/blog/11/5-steps-to-choosing-the-right-builder";
this.page.identifier = "11";
};
(function() {
var d = document, s = d.createElement('script');
s.src = 'https://modh.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</__script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
Disqus module (taken from source view of website):
Code: Select all
<div id="disqus_thread"></div>
<__script__ type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = ""; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</__script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
I am getting the identifier from the blog template. It works perfectly without the module. When using the module, it's not even reading my shortname from the module settings. You will see the field is blank. It's supposed to be 'modh'