Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel 使用分页时如何避免[取消]讨论重复?_Laravel_Laravel 5_Laravel 5.1 - Fatal编程技术网

Laravel 使用分页时如何避免[取消]讨论重复?

Laravel 使用分页时如何避免[取消]讨论重复?,laravel,laravel-5,laravel-5.1,Laravel,Laravel 5,Laravel 5.1,我有问题的论文+laravel分页。我有一个帖子模型,其中一个帖子有一个小帖子,我希望每个帖子包含5个小帖子。。当我导航到第二页时,第二页自动生成了论文讨论。。如何避免这种重复 <div id="disqus_thread"></div> <script> var disqus_config = function () { this.page.url = route('home'); this.page.identifi

我有问题的论文+laravel分页。我有一个帖子模型,其中一个帖子有一个小帖子,我希望每个帖子包含5个小帖子。。当我导航到第二页时,第二页自动生成了论文讨论。。如何避免这种重复

<div id="disqus_thread"></div>
<script>
    var disqus_config = function () {
        this.page.url = route('home');
        this.page.identifier = $slug; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
    };

    (function() { // DON'T EDIT BELOW THIS LINE
    var d = document, s = d.createElement('script');

    s.src = '//testblog.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" rel="nofollow">comments powered by Disqus.</a></noscript>

你不能直接实现它

因为Discus将根据您的url提供评论内容

在分页过程中,您的url可能会更改,您无法停止

同时,您希望在url中的所有页面中仅显示相同的disks内容

你应该用一些巧妙的方法来做

方式1:

在iframe中设置分页和所有内容,以便url不会更改

方式2:

使用jQueryDataTables或其他与之相关的插件,并对其进行更好的定制,以获得您想要的外观

方式3:

探索disks代码,并对该特定页面的url进行硬编码


希望这对您有所帮助

Discus将始终看到url并提供相应的内容。。但是,您应该看到覆盖的方法this@SulthanAllaudeen我该怎么做?有办法做到这一点吗?
$posts = Post::where('slug', $slug)->firstOrFail()->minipost()->orderBy('created_at', 'desc')->paginate(5);
this.page.url = "http://someurl.com/#!" + id;