Integrating Squarespace

Our integration with Squarespace is simply one code drop and two minor edits.

If you experience any issues feel free to contact us with any questions. help@disqus.com

<style>#postform, #comments .caption, #comments .text, #comments .comment-wrapper { display:none; }</style>
<script type="text/javascript">
 var disqus_url = Squarespace.Constants.OBJECT_PERMALINK;
 var disqus_container_id = "comments";
 var disqus_callback = function() {
   var cEl = document.getElementById('comments');
   cEl.innerHTML = '<div id="disqus_thread">' + cEl.innerHTML + '</div>';
 }
</script>
<script type="text/javascript" src="http://disqus.com/forums/_YOURSHORTNAME_/embed.js"></script>
<script>
(function() {
 var links = document.getElementsByTagName('a');
 var query = '?';
 for(var i = 0; i < links.length; i++) {
   if (links[i].href.indexOf('#comments') >= 0) {
     links[i].href = links[i].href.substring(0, links[i].href.length-9) + "#disqus_thread";
     query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
   }
 }
 document.write('<script type="text/javascript" src="http://disqus.com/forums/_YOURSHORTNAME_/get_num_replies.js' + query + '"></' + 'script>');
})();
</script>

SquarespaceHelp (last edited 2009-04-02 00:41:17 by jason)