<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

自定义dede 上一篇下一篇标签调用内容

时间:2020-12-14

上一篇下一篇调用标签:{dede:prenext get='pre'/}{dede:prenext get='next'/}如何自定义织梦dedecms上一篇下一篇标签调用内容呢,例如修改为仅调用上一篇下一篇的链接呢:


找到include目录下的这个文件:arc.archives.class.php
找到这几行:
$this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> ";
$this->PreNext['pre'] = "上一篇:没有了";
$this->PreNext['next'] = "下一篇:<a 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('下一篇:没有了');";
以上是文章内容模型的上一篇下一篇调用标签。

图集模型的修改地方如下:
找到这几行:
*$this->PreNext['preimg'] = "<a 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 href='$mlink'><img src=\"{$nextRow['litpic']}\" alt=\"{$nextRow['title']}\"/></a> ";
$this->PreNext['nextimg'] ="<a 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('对不起,没有下一图集了!');";

我们制作织梦模板的时候,一般都会对显示标题的字数做控制,以免字数过多影响美观等问题。
上一篇和下一篇链接我们都会用到,方便用户浏览。
为了避免文章标题字数过多,影响美观,我们可以对其进行控制。
1、编辑打开include/arc.archives.class.php文件


查找:$this->PreNext['pre'] = "上一篇:{$preRow['title']} ";


在这一行上面加上以下代码


$preRow['title']=cn_substr($preRow['title'],30);//最多显示15个汉字


查找:$this->PreNext['next'] = "下一篇:{$nextRow['title']} ";


在这一行上面加上以下代码


$nextRow['title']=cn_substr($nextRow['title'],30);//最多显示15个汉字


然后再重新生成所有页面即可。

    0
    首页
    案例
    关于
    联系