Warning: Undefined array key "night" in /www/wwwroot/dhaomu.com/wp-content/themes/b2/header.php on line 18

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

织梦教程:dedecms教程织梦根据特定需要调用文章的标签代码!

1、相关文章调用标签

{dede:likeart titlelen='30' row='10'}
 
  <li><a title="[field:title function='htmlspecialchars(@me)'/]" href="[field:arcurl /]">[field:title /]</a></li>
 
  {/dede:likeart}

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

2、热点文章调用标签

{dede:arclist orderby='click' titlelen='30' row='10'}
 
  <li><a title="[field:title function='htmlspecialchars(@me)'/]" href="[field:arcurl /]">[field:title /]</a></li>
 
  {/dede:arclist}

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

3、随机推荐调用标签

{dede:arclist type='commend' titlelen='30' orderby='rand' row='10'}
 
  <li><a title="[field:title function='htmlspecialchars(@me)'/] " href="[field:arcurl /]">[field:title /]</a></li>
 
  {/dede:arclist}

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

4、推荐文章调用标签

{dede:arclist type='commend' titlelen='30' row='10'}
 
  <li><a title="[field:title function='htmlspecialchars(@me)'/] " href="[field:arcurl /]">[field:title /]</a></li>
 
  {/dede:arclist}

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

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

{dede:arclist limit='1,10' titlelen=30 orderby=pubdate typeid='1' idlist='' type='image.' imgwidth='200' imgheight='100'}
 
  <a href="[field:arcurl/]"><img src="[field:picname/]" alt="[field:title/]" ></a>
 
  <a title="[field:title function='htmlspecialchars(@me)'/] " href="[field:arcurl /]">[field:title /]</a>
 
  {/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'}
 
  <a href="[field:typelink/]">[field:typename/]</a>
 
  {/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'}
 
  <LI>
 
  <a href="[field:arcurl /]" title="[field:title function='htmlspecialchars(@me)'/]"
 
  target=_blank>[field:title function="cn_substr(@me,48)"/]</a>
 
  [field:pubdate runphp='yes']
 
  $a="<font color=red>".strftime('%m-%d',@me)."</font>";
 
  $b=strftime('%m-%d',@me);
 
  $ntime = time();
 
  $day3 = 3600 * 24;
 
  if(($ntime - @me) < $day3) @me = $a;
 
  else @me =$b;
 
  [/field:pubdate]<br>
 
  [field:global name=autoindex runphp="yes"]
 
  if(@me%5==0)@me="<hr />";
 
  else @me="";
 
  [/field:global]
 
  {/dede:list}
 
  <DIV class="line2 m1 m3"></DIV>
 
  </LI>

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

{dede:arclist orderby=pubdate titlelen='26' row='10'}
 
  [field:global runphp='yes' name=autoindex]
 
  $a="<div id='a'>";
 
  $b="<div id='b'>";
 
  if ((@me%2)==0) @me=$a;
 
  else @me=$b;
 
  [/field:global]
 
  <ul>
 
  <li>[field:title/]</li>
 
  </ul>
 
  </div>
 
  {/dede:arclist}

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

{dede:arclist row='10' titlelen='24' orderby='pubdate'}
  [field:pubdate runphp='yes']
  $a="<font color=red>".strftime('%m-%d',@me)."</font>";
  $b=strftime('%m-%d',@me);
  $ntime = time();
  $day3 = 3600 * 24;
  if(($ntime - @me) < $day3) @me = $a;
  else @me =$b;
  [/field:pubdate]
  {/dede:arclist}

或者

{dede:arclist row='10' titlelen='24' orderby='pubdate'}
  [field:pubdate runphp="yes"]
  if((time()-@me)<(60*60*24)){@me=' <font color="#ff6600">'.strftime("%m-%d",@me).'</FONT>';}
  else {@me=strftime("%m-%d",@me);}
  [/field:pubdate]
  {/dede:arclist}

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

[field:global name=autoindex/]

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

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

  • 指定channelid属性。
  • 指定要获得的字段 addfields='字段1,字段'

如:

{dede:arclist addfields='filetype,language,softtype' row='8' channelid='3'}
  [field:textlink /] - [field:softtype /]<br />
  {/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'}
  <a href='[field:arcurl/]'>[field:title/]</a>
  {/dede:arclist}

参数说明:

col='' 分多少列显示(默认为单列),dedecms5.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='天数' 表示在多少天以内的文档。
温馨提示:
1.本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:duhaomu@163.com,我们将第一时间处理!
2.资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持。
3.所有资源仅限于参考和学习,版权归原作者所有,更多请阅读网站声明

给TA赞赏
共{{data.count}}人
人已赞赏
编程技巧

织梦缩略图调用原图的方法

2023-1-6 0:00:00

编程技巧

让EcShop后台商品列表搜索关键字支持商品价格搜索

2023-1-8 0:00:00

0 条回复 A文章作者 M管理员

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914
----《》
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索