DedeCMS织梦

DedeCMS专题内容页节点文章排序的修改方法

阿里云

在网站专题内容页中节点排序默认都是按照更新的时间顺序排列的,排序的方式是降序,在调用专题内容页的内容的时候调用的标签也是{dede:field.note/},想要修改调用的排序方法也是可以的。 织梦 dede 专题内容页节点排序的修改方法:

1、{dede:field.note} 其实是用 {dede:arclist}{/dede:arclist} 标签里的 lib_arclistDone 来解析的,所以 orderby 和 order 都是可以控制排序方法的,orderby 是文档排序方式,order 是降序还是升序。

也想出现在这里?联系我们
创客主机

2、打开 dede/spec_add.php 和 dede/spec_edit.php ,在这两个文件里均找到代码:

  1. $notelist .= "{dede:specnote imgheight=\'$imgheight\' imgwidth=\'$imgwidth\'
  2. infolen=\'$infolen\' titlelen=\'$titlelen\' col=\'$col\' idlist=\'$okids\'
  3. name=\'$notename\' noteid=\'$noteid\' isauto='$isauto' rownum=\'$rownum\'
  4. keywords=\'$keywords\' typeid=\'$typeid\'}

2 个文件里边的这段内容都是相同的,在 typeid=\'$typeid\' 后边加入:

  1. order=\'asc\'

注意:order 前边有个空格。

3、打开 include/taglib/channel/specialtopic.lib.php ,找到代码:

  1. $ctag->GetAtt('att')

在其后边加入:

  1. ,$ctag->GetAtt('order')

4、找到 specialtopic.lib.php 第 51 行中的 default 改为 id 即可。

修改完以上文件后,上传覆盖,再生成专题页,可以看到文章已经按 ID 升序排列了!

DedeCMS 专题内容页节点文章排序的修改方法

已有 2595 人购买
查看演示升级 VIP立刻购买

收藏
(1)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!