织梦标签调用:根据特定需求调用文章的标签代码

1、相关文章调用标签

{dede:likeart titlelen=‘30’ row=‘10’}
  

  • [field:title /]

  •   {/dede:likeart}

    表示读取10条相关文章,标题长度30个字符。

    2、热点文章调用标签

    {dede:arclist orderby=‘click’ titlelen=‘30’ row=‘10’}
      

  • [field:title /]

  •   {/dede:arclist}

    表示读取10条热点文章,标题长度30个字符。

    3、随机推荐调用标签

    {dede:arclist type=‘commend’ titlelen=‘30’ orderby=‘rand’ row=‘10’}
      

  • [field:title /]

  •   {/dede:arclist}

    表示随机读取10条推荐文章,标题长度30个字符。

    4、推荐文章调用标签

    {dede:arclist type=‘commend’ titlelen=‘30’ row=‘10’}
      

  • [field:title /]

  •   {/dede:arclist}

    表示读取10条推荐文章,标题长度30个字符

    5、指定从第二篇文章开始调用的图文标签

    {dede:arclist limit=‘1,10’ titlelen=30 orderby=pubdate typeid=‘1’ idlist=’’ type=‘image.’ imgwidth=‘200’ imgheight=‘100’}
      [field:title/]
      [field:title /]
      {/dede:arclist}

    马海祥博客注:指定频道加上typeid=‘1’表示调用ID为1的频道;idlist =’'提取特定文档(文档ID);limit=‘起始ID,记录数’(起始ID从0开始),表示限定的记录范围(如:limit=‘1,10’ 表示从ID为1的记录开始,取10条记录;调用指定id文档例子idlist=‘1,2,3,4’

    6、在首页调用某栏目的子栏目

    {dede:channel type=‘sun’ typeid=‘栏目ID’}
      [field:typename/]
      {/dede:channel}

    7、按时间点击文章排行榜调用标签

    按总: {dede:arclist row=‘20’ titlelen=30 orderby=click}

    按月: {dede:arclist row=‘20’ titlelen=30 orderby=click subday=30}

    按周: {dede:arclist row=‘20’ titlelen=30 orderby=click subday=7}

    8、列表隔5行加一行线

    {dede:list pagesize=‘50’}
      


  •   [field:title function=“cn_substr(@me,48)”/]
      [field:pubdate runphp=‘yes’]
       a = &quot; &lt; f o n t c o l o r = r e d &gt; &quot; . s t r f t i m e ( ′     a=&quot;&lt;font color=red&gt;&quot;.strftime(&#x27;%m-%d&#x27;,@me).&quot;&lt;/font&gt;&quot;;    a="<fontcolor=red>".strftime(  b=strftime(’%m-%d’,@me);
       n t i m e = t i m e ( ) ;     ntime = time();    ntime=time();  day3 = 3600 * 24;
      if(($ntime - @me) < $day3) @me = a ;     e l s e @ m e = a;   else @me = a;  else@me=b;
      [/field:pubdate]

      [field:global name=autoindex runphp=“yes”]
      if(@me%5==0)@me="
    ";
      else @me="";
      [/field:global]
      {/dede:list}
      

      
  • 9、文章列表“隔行换色”的方法

    {dede:arclist orderby=pubdate titlelen=‘26’ row=‘10’}
      [field:global runphp=‘yes’ name=autoindex]
       a = &quot; &lt; d i v i d = ′ a ′ &gt; &quot; ;     a=&quot;&lt;div id=&#x27;a&#x27;&gt;&quot;;    a="<divid=a>";  b="

    ";
      if ((@me%2)==0) @me= a ;     e l s e @ m e = a;   else @me= a;  else@me=b;
      [/field:global]
      

    •   
    • [field:title/]

    •   

      

      {/dede:arclist}

    10、当天内发布更新的文章时间显示为红色

    {dede:arclist row=‘10’ titlelen=‘24’ orderby=‘pubdate’}
      [field:pubdate runphp=‘yes’]
       a = &quot; &lt; f o n t c o l o r = r e d &gt; &quot; . s t r f t i m e ( ′     a=&quot;&lt;font color=red&gt;&quot;.strftime(&#x27;%m-%d&#x27;,@me).&quot;&lt;/font&gt;&quot;;    a="<fontcolor=red>".strftime(  b=strftime(’%m-%d’,@me);
       n t i m e = t i m e ( ) ;     ntime = time();    ntime=time();  day3 = 3600 * 24;
      if(($ntime - @me) < $day3) @me = a ;     e l s e @ m e = a;   else @me = a;  else@me=b;
      [/field:pubdate]
      {/dede:arclist}

    {dede:arclist row=‘10’ titlelen=‘24’ orderby=‘pubdate’}
      [field:pubdate runphp=“yes”]
      if((time()-@me)<(606024)){@me=’ ‘.strftime("%m-%d",@me).’’;}
      else {@me=strftime("%m-%d",@me);}
      [/field:pubdate]
      {/dede:arclist}

    11、列表文章的递增序列号调用标签

    [field:global name=autoindex/]

    12、用arclist调用于附加表字段的方法

    要获取附加表内容,必须符合两个条件:

    1、指定channelid属性。

    2、指定要获得的字段 addfields=‘字段1,字段’

    如:

    {dede:arclist addfields=‘filetype,language,softtype’ row=‘8’ channelid=‘3’}
      [field:textlink /] - [field:softtype /]

      {/dede:arclist}

    标签名称:arclist

    标记简介:织梦常用标记,也称为自由列表标记,其中imglist、imginfolist、specart、coolart、autolist都是由该标记所定义的不同属性延伸出来的别名标记。

    功能说明:获取指定文档列表

    适用范围:全局使用

    基本语法:

    {dede:arclist flag=‘h’ typeid=’’ row=’’ col=’’ titlelen=’’ infolen=’’ imgwidth=’’ imgheight=’’ listtype=’’ orderby=’’ keyword=’’ limit=‘0,1’}
      [field:title/]
      {/dede:arclist}

    参数说明:

    col=’’ 分多少列显示(默认为单列),dedecms5.3以后的版本中本属性可以通过多种方式进行多行显示。

    如果col='1’要多列显示的可用div+css实现,以下为通过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,记录数’(起始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=‘天数’ 表示在多少天以内的文档。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值