dedecms专题内容页{dede:field.note /}节点排序的方法

dedecms专题内容页{dede:field.note /}节点排序默认是按照更新时间降序排列的,我现在想让它升序排列,该怎么修改呢,请看下文:
 
1、{dede:field.note}其实是用{dede:arclist}{/dede:arclist}标签里的lib_arclistDone来解析的,从{dede:arclist}标签的参数可以获知,和排序相关的是orderby和order,orderby是文档排序方式,order是降序还是升序,也就是desc还是asc,理解了这里就能进行下边的操作了。
 
2、打开dede/spec_add.php和dede/spec_edit.php,分别找到:
 
$notelist .= "{dede:specnote imgheight=\\'$imgheight\\' imgwidth=\\'$imgwidth\\' 
                infolen=\\'$infolen\\' titlelen=\\'$titlelen\\' col=\\'$col\\' idlist=\\'$okids\\' 
                name=\\'$notename\\' noteid=\\'$noteid\\' isauto=\'$isauto\' rownum=\\'$rownum\\' 
                keywords=\\'$keywords\\' typeid=\\'$typeid\\'} 
 
2个文件里边的这段内容都是相同的,在
 
typeid=\\'$typeid\\' 
后边加入
 
order=\\'asc\\'
order前边有个空格噢,别忘了。
 
这步实现的是添加和修改专题的时候在底层模板里加入排序的2个字段。
 
order值为asc或者desc
 
3、打开include/taglib/channel/specialtopic.lib.php,找到
 
$ctag->GetAtt('att') 
在其后边加入
 
,$ctag->GetAtt('order')
 
4、找到specialtopic.lib.php第51行中的default改为id即可。
 
到这里就大功告成了。
 
注意:已经发布的专题需要修改,保存后才能生效。本文在dedecms5.7SP1下成功调用,其他版本未作测试。