模板标签这样写:
{dede:arclist idlist=’1,2,110,108,109′ orderby=’idlist’}
<p><a href=”[field:arcurl/]”>[field:id/] – [field:title/]</a></p>
{/dede:arclist}
输出来居然是这样的,不能按照文档的id依次输出,如下图所示:
解决方法:
1、打开 /include/taglib/arclist.lib.php 找到,大概在第338行
else if($orderby == 'rand') $ordersql = " ORDER BY rand()";
在它下面加入一行:
else if($orderby == 'idlist') $ordersql = " ORDER BY FIELD(arc.id,$idlist)";
2、dede:arclist idlist=” 标签里加入orderby=’idlist’
最终效果: