在织梦默认的调用文章上/下一篇的时候如果下面为空的就会出现“没有了”,但是如果想要出现这样的文字,而是自己独特设置的文字的话,就要在调用标签上下点功夫了。
dedecms上一篇下一篇的调用标签:
{dede:prenext get='pre'/} {dede:prenext get='next'/} dede修改上/下一篇中“没有了”的方法
方法一:直接删除“没有了”
打开include/arc.archives.class.php 找到 $this->PreNext['pre'] = "上一篇:<a rel="nofollow noopener noreferrer" href='$mlink'>{$preRow['title']}</a> "; $this->PreNext['pre'] = "上一篇:没有了"; $this->PreNext['next'] = "下一篇:<a rel="nofollow noopener noreferrer" href='$mlink'>{$nextRow['title']}</a> "; $this->PreNext['next'] = "下一篇:没有了 "; 删除“没有了”即可
方法二:使用其他代码替换“没有了”
打开include/arc.archives.class.php 找到 $this->PreNext['pre'] = "上一篇:<a rel="nofollow noopener noreferrer" href='$mlink'>{$preRow['title']}</a> "; $this->PreNext['pre'] = "上一篇:没有了"; $this->PreNext['next'] = "下一篇:<a rel="nofollow noopener noreferrer" href='$mlink'>{$nextRow['title']}</a> "; $this->PreNext['next'] = "下一篇:没有了 "; 分别替换为以下几行: $this->PreNext['pre'] = "$mlink"; $this->PreNext['pre'] = "javascript:window.alert('上一篇:自己想要的话');"; $this->PreNext['next'] = "$mlink"; $this->PreNext['next'] = "javascript:window.alert('下一篇:自己想要的话');";
以上就是在文章内容模型中的修改方法了,如果想要在图集中也不显示“没有了”,还要做一些修改:
打开include/arc.archives.class.php 找到 *$this->PreNext['preimg'] = "<a rel="nofollow noopener noreferrer" href='$mlink'><img src=\&;{$preRow['litpic']}\&; alt=\&;{$preRow['title']}\&;/></a> "; $this->PreNext['preimg'] ="<img src=\&;/templets/default/images/nophoto.jpg\&; alt=\&;对不起,没有上一图集了!\&;/>"; $this->PreNext['nextimg'] = "<a rel="nofollow noopener noreferrer" href='$mlink'><img src=\&;{$nextRow['litpic']}\&; alt=\&;{$nextRow['title']}\&;/></a> "; $this->PreNext['nextimg'] ="<a rel="nofollow noopener noreferrer" href='javascript:void(0)' alt=\&;\&;><img src=\&;/templets/default/images/nophoto.jpg\&; alt=\&;对不起,没有下一图集了!\&;/></a>"; 分别替换为以下几行: $this->PreNext['preimg'] = "$mlink"; $this->PreNext['preimg'] ="javascript:window.alert('自己想要的话');"; $this->PreNext['nextimg'] = "$mlink"; $this->PreNext['nextimg'] ="javascript:window.alert('自己想要的话');";