We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16834
    • 93 Posts
    Hello

    Has anybody got disqus working within a modx site? I really like the way that comments are then integrated across up to 45,000 other sites leading to truly global conversations.

    There are a number of integrations for other CMS’s such as Drupal, Typepad, Wordpress and Joomla. I am not a coder so do not really know where to go about it.

    For those that need to know more http://www.disqus.com

    To see a great blog that uses disqus to manage its commenting see http://www.avc.com

    Thanks for any advice.

    L
      • 6726
      • 7,075 Posts
      You could always go with the generic JS : register, go to admin > tools and generate the js for your website, you’ll get something like this :

      <script type="text/javascript" src="http://disqus.com/forums/yoursite/combination_widget.js?num_items=5&color=blue&default_tab=people"></script>


      That’s all there is to it...

      For developpers willing to look into further integration :
      http://www.disqus.com/docs/api/
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l&#39;outil id
        • 16834
        • 93 Posts
        Hi David

        Since posting, I had tried the above but it takes the visitor to page at disqus to see the comment thread.

        Other sites have the disqus elements embedded in the original page. I am trying to gain that effect.

        Thanks

        L:
          • 6726
          • 7,075 Posts
          There is a way... did it for a website but un-did that and don’t remember how I did it rolleyes
          I’ll see if I can find the code I used...
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l&#39;outil id
            • 16834
            • 93 Posts
            oooooooh please, please, please ;-)

            L
              • 6726
              • 7,075 Posts
              Well, I forgot about the second code snippet required to implement disqus, which you need to place before the closing body tag (</body>) in your template :


              <script type="text/javascript">
              //<![CDATA[
              (function() {
              		var links = document.getElementsByTagName('a');
              		var query = '?';
              		for(var i = 0; i < links.length; i++) {
              			if(links[i].href.indexOf('#disqus_thread') >= 0) {
              				query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
              			}
              		}
              		document.write('<script type="text/javascript" src="http://disqus.com/forums/your-site/get_num_replies.js' + query + '"></' + 'script>');
              	})();
              //]]>
              </script>
              


              Of course it implies you created an account @disqus !

              This is explained @ http://disqus.com/integrate/your-site/generic/

              To link to the comments your need to add the [tt]#disqus_thread[/tt] anchor to the comment link
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l&#39;outil id
                • 16834
                • 93 Posts
                ah - OK. I will have a look at this again. I thought I had done all this last night.... Start from square one maybe.

                I really appreciate the help, David.