标签称号:arclist
标记简介:织梦经常运用标记,也称为自在列表标记,个中imglist、imginfolist、specart、coolart、autolist都是由该标记所定义的差别属性延长出来的别号标记。 【引荐进修:dedecms视频教程】
功用申明:猎取指定文档列表
适用局限:全局运用
基础语法:
{dede:arclist flag='h' typeid='' row='' col='' titlelen='' infolen='' imgwidth='' imgheight='' listtype='' orderby='' keyword='' limit='0,1'} <a href='[field:arcurl/]'>[field:title/]</a> {/dede:arclist}
参数申明:
col='' 分若干列显现(默以为单列),5.3版中本属性能够经由过程多种体式格局举行多行显现
假如col='1'要多列显现的可用div+css完成
以下为经由过程div+css完成多列的示例:
<style type=text/css> div{width:400px;float:left;} </style> {dede:arclist row='10' titlelen='24' orderby='pubdate' idlist='' col='2'} ?[field:textlink/]([field:pubdate function=MyDate('m-d',@me)/])<br/> {/dede:arclist}
当col>1将运用本来的table多列体式格局显现
row='10' 返回文档列表总数 typeid='' 栏目ID,在列表模板和档案模板中平常不需要指定,在首页模板中许可用","离开示意多个栏目; getall='1' 在没有指定这属性的情况下,在栏目页、文章页模板,不会猎取以","离开的多个栏目的下级子类 titlelen = '30' 题目长度 等同于titlelength infolen='160' 示意内容简介长度 等同于infolength imgwidth='120' 缩略图宽度 imgheight='90' 缩略图高度 listtype='all' 栏目范例 image含有缩略图 commend引荐 orderby='sortrank' 文档排序体式格局 § orderby='hot' 或 orderby='click' 示意按点击数分列 § orderby='sortrank' 或 orderby='pubdate' 按出书时候分列 § orderby='near' § orderby=='lastpost' 按末了批评时候 § orderby=='scores' 按得分排序 § orderby='id' 按文章ID排序 § orderby='rand' 随机取得指定前提的文档列表 keyword='' 含有指定关键字的文档列表,多个关键字用","分 innertext = '' 单条纪录款式 aid='' 指定文档ID idlist ='' 提取特定文档(文档ID) channelid 频道ID limit='肇端ID,纪录数' (肇端ID从0最先)示意限制的纪录局限(如:limit='1,2' 示意从ID为1的纪录最先,取2条纪录) flag = 'h' 自定义属性值:头条[h]引荐[c]图片[p]幻灯[f]转动[s]跳转[j]图文[a]加粗[b] noflag = '' 同flag,但这里是示意不包括这些属性 orderway='desc' 值为 desc 或 asc ,指定排序体式格局是降序照样顺向排序,默以为降序 subday='天数' 示意在若干天之内的文档
用arclist挪用于附加表字段的要领:
要猎取附加表内容,必需相符两个前提
1、指定 channelid 属性
2、指定要取得的字段 addfields='字段1,字段'
如:
{dede:arclist addfields='filetype,language,softtype' row='8' channelid='3'} [field:textlink /] - [field:softtype /]<br /> {/dede:arclist}
底层模板字段:
ID(同 id),typeid,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer, source,litpic(同picname),pubdate,senddate,mid, lastpost,scores,goodpost,badpost,notpost, description(同infos),filename, image, imglink, fulltitle, textlink, typelink,plusurl, memberurl, templeturl, stime(pubdate 的"0000-00-00"花样)
个中:
textlink = <a href='arcurl'>title</a> typelink = <a href='typeurl'>typename</a> imglink = <a href='arcurl'><img src='picname' border='0' width='imgwidth' height='imgheight'></a> image = <img src='picname' border='0' width='imgwidth' height='imgheight' alt=’titile’>
字段挪用要领:[field:varname/]
如:
{dede:arclist infolen='100'} [field:textlink/] <br> [field:infos/] <br> {/dede:arclist}
注:底层模板里的Field完成也是织梦标记的一种情势,因而支撑运用PHP语法,Function扩大等功用。
如: 给当天宣布的内容加上 (new) 标志
[field:senddate runphp='yes'] $ntime = time(); $oneday = 3600 * 24; if(($ntime - @me)<$oneday) @me = "<font color='red'>(new)</font>"; else @me = ""; [/field:senddate] [b][/b]
更多织梦cms相干学问,可接见织梦cms 栏目!!
以上就是织梦cms的arclist标签经常运用吗的细致内容,更多请关注ki4网别的相干文章!