Dedecms   发布时间:2019-10-30  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了dede标签:arclist标签使用大全大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

<div id="app-share-content">

特别提示:arclist是织梦建站系统中最重要的标签,同时也是最基础的标签,希望大家熟练掌握,可以说是学习织梦必备知识。

标签名称:arclist
标记简介:织梦常用标记,也称为自由列表标记,其中imglist、imginfolist、specart、coolart、autolist都是由该标记所定义的不同属性延伸出来的别名标记。
功能说明:获取指定文档列表
适用范围:全局使用
基本语法
BACkground-color: #99ccff;">{dede:arclist flag='h' typEID='' row='' col='' titlelen='' infolen='' imgwidth='' imgheight='' listtype='' orderby='' keyword='' limit='0,1'}
[field:title/]
{/dede:arclist}

BACkground-color: #99ccff;">typEID='' 栏目ID,在列表模板和档案模板中一般不需要指定,在首页模板中允许用","分开表示多个栏目;

BACkground-color: #99ccff;">orderby='sortrank' 文档排序方式
§ orderby='hot' 或 orderby='click' 表示按点击数排列
§ orderby='sortrank' 或 orderby='pubdate' 按出版时间排列
§ orderby='near'
§ orderby=='lastpost' 按最后评论时间
§ orderby=='scores' 按得分排序
§ orderby='id' 按文章ID排序
§ orderby='rand' 随机获得指定条件的文档列表

BACkground-color: #99ccff;">idlist ='' 提取特定文档(文档ID) 调用指定id文档 例子idlist ='4,45,78,237'
limit='起始ID,记录数' (起始ID从0开始)表示限定的记录范围(如:limit='1,2' 表示从ID为1的记录开始,取2条记录)
keyword='' 含有指定关键字的文档列表,多个关键字用","分
orderway='desc' 值为 desc 或 asc ,指定排序方式是降序还是顺向排序,默认为降序

BACkground-color: #99ccff;">BACkground-color: #99ccff;">

{dede:arclist flag="c" chAnnelid='' row='10' titlelen='60' orderby=''}


  • {/dede:arclist}


    调用最新文章按发布时间排序


  • {/dede:arclist} titlelen='60'标题长度为30汉字
    按ID排序降序排列,从大到小

    LPADding="0"> {dede:arclist chAnnelid='' row='10' titlelen='60' }

  • {/dede:arclist}
    按ID排序顺序排列,从小到大
    }

  • {/dede:arclist} 默认为降序

    调用含有缩图的文档
    LPADding="0"> {dede:arclist flag="p" row='10' titlelen='60'}



  • {/dede:arclist}
    日期的各种格式
    LPADding="0"> @mE)/]
    08日[field:pubdate function=strftime('%d日',@mE)/]
    06-08[field:pubdate function=strftime('%m-%d',@mE)/]
    06月08日[field:pubdate function=strftime('%m月%d日',@mE)/]
    09-06-08[field:pubdate function=strftime('%y-%m-%d',@mE)/]
    2009-06-08[field:pubdate function=strftime('%Y-%m-%d',@mE)/]
    @mE)/]
    2009年06月08日[field:pubdate function=strftime('%Y年%m月%d日',@mE)/]
    2009-06-0813:28[field:pubdate function=strftime('%Y-%m-%d %H:%M',@mE)/]

    底层字段
    LPADding="0"> LPADding="0"> EID /]6964@/]titlelen=''字节数,后台发布文档时所选的标题颜色,加粗)title/]title /]source /]@mE)/]字数控制 [field:description function="cn_substr(@me,120)"/] 60汉字
    infolen='160' 表示内容简介长度 等同于infolength字数控制 [field:info function="cn_substr(@me,120)"/] 60汉字
    infolen='160' 表示内容简介长度 等同于infolength(只控制infos,并不控制description的内容字数控制 [field:infos function="cn_substr(@me,120)"/] 60汉字
    infolen='160' 表示内容简介长度 等同于infolength(只控制infos,并不控制description的内容)ename /]ename /][field:title/]
    imgwidth='120' 缩略图宽度
    imgheight='90' 缩略图高度
    [field:image /]ename /][field:typename /]可CSS控制可做成各种样式效果,比如隔行换色,列表前加入1-10数字序号,每隔几行换行等等
    php搭配,可制作出各种效果,为DEDE最重要代码之一


    相关函数:
    文件\include\taglib\arclist.lib.php第7行
    function lib_arclist(&$ctag,&$refObj)
    参数说明
    col='' 分多少列显示(默认为单列),5.3版中本属性可以通过多种方式进行多行显示

    以下为通过div+css实现多列的示例:

    {dede:arclist row='10' titlelen='24' orderby='pubdate' idlist='' col='2'}
    ?[field:textlink/]([field:pubdate function=MyDate('m-d',@mE)/])

    {/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,2' 表示从ID为1的记录开始,取2条记录)
    flag = 'h' 自定义属性值:头条[h]推荐[c]图片[p]幻灯[f]滚动[s]跳转[j]图文[a]加粗
    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 /]

    {/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 = title
    typelink = typename
    imglink =
    image = ’titile’
    字段调用方法:[field:varname/]
    如:
    {dede:arclist infolen='100'}
    [field:textlink/]


    [field:infos/]


    {/dede:arclist}
    注:底层模板里的Field实现也是织梦标记的一种形式,因此支持使用php语法,Function扩展等功能。
    如: 给当天发布的内容加上 标志
    [field:senddate runphp='yes']
    $ntime = time();
    $oneday = 3600 * 24;
    if(($ntime - @mE)<$oneday) @me = "(new)@H_607_305@";
    else @me = "";
    [/field:senddate]
    为了您的安全,请只打开来源可靠的网址

    来自: http://hi.baidu.com/yaoling_2010/blog/item/e5abda9048ad1c02d31b7040.html" target="_blank">http://hi.baidu.com/yaoling_2010/blog/item/e5abda9048ad1c02d31b7040.html

    大佬总结

    以上是大佬教程为你收集整理的dede标签:arclist标签使用大全全部内容,希望文章能够帮你解决dede标签:arclist标签使用大全所遇到的程序开发问题。

    如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

    本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
    如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
    标签: