Question

We are using Disqus in a standard way within a large web page

<div id="disqus_thread"></div>

and then the script.

The question is

is there an easy way to test this locally ? I only care to test how it's going to look like, how it fits ? I am just concentrating on the User interface so I would like to fill the div with some fake comments or something similar... it's a bit like when people who test layout put latin stuff as content...

Was it helpful?

Solution

First tell disqus you are in developer mode so it will allow your local website to load disqus js script, this way:

<script type="text/javascript">
    /* * * CONFIGURATION VARIABLES: THIS CODE IS ONLY AN EXAMPLE * * */
    var disqus_shortname = 'example'; // Required - Replace example with your forum     shortname
    var disqus_identifier = 'a unique identifier for each page where Disqus is present';
    var disqus_title = 'a unique title for each page where Disqus is present';
    var disqus_url = 'a unique URL for each page where Disqus is present';
    /* * * REMOVE THE FOLLOWING LINE IN PRODUCTION * * */
    var disqus_developer = 1;
    /* * * 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>

After that you can use disqus import feature to load lots of test comments. Also I recommend you to read the best practices.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top