设为首页收藏本站

模板库

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 8317|回复: 0
打印 上一主题 下一主题

[教程] 织梦dedecms全局标签详解:arclist标签

[复制链接]
  • TA的每日心情
    无聊
    2013-6-9 09:06
  • 签到天数: 10 天

    [LV.3]偶尔看看II

    跳转到指定楼层
    楼主
    发表于 2011-7-28 09:39:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    今天来详细说说织梦dedecms模板全局标签:arclist标签
    arclist标签简介:织梦常用标记,也可以称为自由列表标记,其中imglist、imginfolist、specart、coolart、autolist都是由该标记所定义的不同属性延伸出来的别名标记。
    arclist标签功能说明:获取指定文档列表
    arclist标签适用范围:全局使用
    arclist标签基本语法如下:
    {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}
    arclist标签基本参数说明:
    col='' 分多少列显示(默认为单列),

    如果col='1'要多列显示的可用div+css实现
    以下为通过div+css实现多列的示例:
    <style type=text/css>
    div{width:500px;float:left;}
    </style>
    {dede:arclist row='8' titlelen='32' orderby='pubdate' idlist='' col='4'}
    •[field:textlink/]([field:pubdate function=MyDate('m-d',@me)/])<br/>
    {/dede:arclist}
    当col>1将使用原来的table多列方式显示
    row='8' 返回文档列表总数
    typeid='' 栏目ID,在列表模板和档案模板中一般不需要指定,在首页模板中允许用","分开表示多个栏目;
    getall='1' 在没有指定这属性的情况下,在栏目页、文章页模板,不会获取以","分开的多个栏目的下级子类
    titlelen = '32' 标题长度 等同于titlelength
    infolen='200' 表示内容简介长度 等同于infolength
    imgwidth='110' 缩略图宽度
    imgheight='100' 缩略图高度
    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]滚动跳转[j]图文[a]加粗
    noflag = '' 同flag,但这里是表示不包含这些属性
    orderway='desc' 值为 desc 或 asc ,指定排序方式是降序还是顺向排序,默认为降序
    subday='天数' 表示在多少天以内的文档

    织梦模板中用arclist调用于附加表字段的方法:

    要获取附加表内容,必须符合两个条件
    1、指定 channelid 属性
    2、指定要获得的字段 addfields='字段1,字段'
    如:
    {dede:arclist addfields='filetype,language,softtype' row='6' channelid='1'}
    [field:textlink /] - [field:softtype /]<br />
    {/dede:arclist}


    织梦dedecms底层模板字段:
    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='200'}
    [field:textlink/]
    <br>
    [field:infos/]
    <br>
    {/dede:arclist}
    注:在织梦dedecms底层模板里面的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]


    这里详细说明了织梦dedecms全局标签arclist标签。
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|申请友链|小黑屋|手机版|Archiver|星雨网络工作室    

    GMT+8, 2026-6-10 13:34 , Processed in 0.146909 second(s), 21 queries .

    Powered by Discuz! X3.1

    © 2001-2013 站长论坛

    快速回复 返回顶部 返回列表