几个disqus线程在一个页面上 [英] Several disqus-threads on one page

查看:108
本文介绍了几个disqus线程在一个页面上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



因此,我们想使用disqus,我们有一个网站,我们列出了很多事件,并希望为每个事件添加讨论。并检查出来。原来他们使用全局变量来配置实例。



like;

  var disqus_shortname =''; 

var disqus_identifier ='';

var disqus_url ='';

这对我们来说是一个问题,当我们不想使用相同的标识符时,而是每个Disqus实例都有一个唯一的。试图把每个实例+配置放在iframe中,但是真的搞砸了ie8。有没有更好的方法呢?



所以,总结一下;在一个页面上的几个disqus实例。怎么样?
有别人做过吗?



感谢

解决方案

我们遇到了类似的问题,并通过电子邮件发送至Disqus。他们证实,默认情况下,他们只支持每页Disqus模块。



在浏览Disqus JS文档时,我确实找到了一个解决方案,可以通过加载和卸载用户与网站交互的Disqus模块:

  DISQUS.reset({
reload:true,
config:function(){
this.page.identifier =newidentifier;
this.page.url =http://example.com/#!newthread;
}
});

http://docs.disqus.com/help/85/



确切的实施将取决于您的网站,但这应该为您提供积木从开始。例如,如果事件信息通过展开内容区域变得可用,那么只要有人展开事件内容,就可以加载Disqus模块。


we have a website where we have list a lot of events, and would like to add discussions to each of the events.

So we wanted to use disqus, and checked it out. Turns out they use global variables to configure the instance.

like;

var disqus_shortname = '';

var disqus_identifier = '';

var disqus_url = '';

This poses a problem for us, when we don't want to use the same identifier, but rather a unique one per disqus instance. tried putting each instantiation + configuration in iframes, but that really screwed up ie8. is there a better way of doing it?

So, to sum it up; several instances of disqus on one page. how? has someone else done it?

Thanks

解决方案

We faced a similar issue and emailed Disqus about this. They confirmed that by default they only support one Disqus module per page.

When browsing the Disqus JS documentation, I did find a solution that might work for you by loading and unloading the Disqus modules as the user interacts with the site:

DISQUS.reset({
  reload: true,
  config: function () {  
    this.page.identifier = "newidentifier";  
    this.page.url = "http://example.com/#!newthread";
  }
});

http://docs.disqus.com/help/85/

The exact implementation would depend upon your site, but this should give you a building block to start from. For example, if the event information becomes available by expanding a content area, you could load the Disqus module whenever someone expands the event content.

这篇关于几个disqus线程在一个页面上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆