POST TIME:2019-09-30 11:11
(>=DedeCMS 3,DedeCMS 4,DedeCMS 5)
名称:list
功能:获取列表模板中的列表内容
语法:
{dede:list col='' titlelen=''
infolen='' imgwidth='' imgheight='' orderby='' pagesize=''}{/dede:list}文件:
includerc.listview.class.php
includerc.sglistview.class.php
function GetArcList($limitstart=0,$row=10,$col=1,$titlelen=30,$infolen=250,
$imgwidth=120,$imgheight=90,$listtype="all",$orderby="default",$innertext="",$tablewidth="100",$ismake=1,$orderWay='desc')
默认底层模板:
list_fulllist.htm
参数:
col=1内容列数
titlelen=30标题长度
infolen=250内容摘要长度
imgwidth=120缩略图宽
imgheight=90缩略图高
orderby='default'排序方式,有效的排序方式有senddate、pubdate、id、click、lastpost、postnum,默认为sortrank
pagesize=20分页大小
orderway='desc'排序方式
底层字段:
ID(同id),title,iscommend,color,typeid,ismake,description(同info),postnum,lastpost,shorttitle
pubdate,senddate,arcrank,click,litpic(同picname),typedir,typename,
arcurl(同filename),typeurl,stime(pubdate的"0000-00-00"格式),
textlink,typelink,imglink,image
范例:
{dede:list pagesize='10'}
<li> [field:array runphp='yes']@me = (empty(@me['litpic']) ? "" : "<a href='{@me['arcurl']}' class='preview'><img src='{@me['litpic']}'/></a>"); [/field:array] [<b>[field:typelink/]</b>] <a href="[field:arcurl/]" class="title">[field:title/]</a> <span class="info"> <small>日期:</small>[field:pubdate function="GetDateTimeMK(@me)"/] <small>点击:</small>[field:click/] <small>好评:</small>[field:scores/] </span> <p class="intro"> [field:description/]... </p> </li> {/dede:list}list标签同时也适用单表模型文档列表。
注:list标记除了支持档案表的基本模板变量外,还支持附加表的字段,你可以在模型管理中知道附加表支持列表使用的字段有哪些。