玄龙CMS list标签调用分页数据
xuanlong list调用分页数据列表
注意:分页数据标签只能在列表页使用
1 2 3 4 5 6 7 8 9 10 11 12 | /* * 参数说明: * pagesize 每页显示多少条 * flag 文章属性标签 多个标签用,逗号隔开 //h头条|c推荐|f幻灯|a特荐|s滚动|b加粗|p带缩略图|j跳转|r热点 * titlelen 文章标题长度,每个中文占2个长度 * infolen 文章描述长度,每个中文占2个长度 * orderby 排序方式 参数[hot、click、id、pubdate、weight、senddate] * orderway 默认降序 参数[asc、desc] * orderway 默认降序 参数[asc、desc] * @empty 没有数据时显示的内容 * typeid 默认不用填写,若填写此参数则调用指定栏目分类 可以指定任意栏目进行分页 */ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | 调用分页数据: {xuanlong:list pagesize= '2' titlelen= '60' infolen= "200" flag= 'c,p' orderby= 'id' orderway= 'desc' @ empty = "[[<div style=" color:red ">暂无数据</div>]]" } {{xuanlong: if [field:litpic/]!= '' }} //判断文章缩略图不为空时输出 <img src= "[field:litpic/]" /> {{/xuanlong: if }} [field:id/] //文章ID [field:arcurl/] //文章地址 [field:infos/] //会受到infolen长度影响 [field:description/] //不会受到infolen长度影响,调用所有 [field:click/] //点击 [field:typename/] //所属栏目 [field:typedir/] //所属栏目地址 [field:senddate function = "MyDate(@me," Y-m-d H:i:s ")" /] //发布时间 2022-10-12 12:25:25 [field:xxxx/] 关联存在的字段或者用户自定义的字段 -----------------------------------------------------------<br> //1、自定义函数调用 [field:title function = "html2text(@me)" /] //调用自定义函数html2text对标题进行处理 -----------------------------------------------------------<br> //2、$k 系统自带的,默认从0开始的,根据条数递增的 {xuanlong:php} echo $k ;{/xuanlong:php} -----------------------------------------------------------<br> //3、内部标签中if elseif 判断 {{xuanlong: if [field:id/]==3}} first--[field:id/] {{xuanlong: elseif [field:id/]==2}} two--[field:id/] {{xuanlong: else /}} other--[field:id/] {{/xuanlong: if }} --------------------------------------------------------<br> //4、php语法 if else运算 注:php中注释请使用 //xxx 或者 /*xxx*/ {xuanlong:php} if ( $k ==0){ echo 'class="aaa"' ; } else { echo 'class="bbb"' ; } {/xuanlong:php} -----------------------------------------------------------<br> //5、获取文章自定义图集字段 {xuanlong:custom= 'imgs' limit= "0,3" @ empty = "[[<div style=" color:red ">暂无数据</div>]]" } //调用图集0至3张图 imgs为图集字段名 没有数据时候显示红色字体 暂无数据 {xuanlong:php} echo $k ;{/xuanlong:php} //用户自定义图集循环自增 默认从0开始的 <br> [field:title/] //当前图片所属文章标题<br> [field:arcurl/] //当前图片所属文章地址<br> [field:img_txt/] //固定字段,图集图片说明<br> [field:img_src/] //固定字段,图片地址<br> {{xuanlong: if [field:id/]==3}} //判断当前图集所属文章ID为3时成立 first--[field:id/] {{xuanlong: elseif $k ==2}} //当前图集第三张图片时成立 two--[field:img_txt/] {{xuanlong: else /}} other--[field:img_src/] {{/xuanlong: if }} {/xuanlong:custom} //6、获取文章自定义图集字段 {xuanlong:custom= 'ddd' limit= "0,3" @ empty = "[[<h1>暂无数据</h1>]]" } //调用图集0至3张图 ddd为图集字段名 没有数据时候输出 加粗样式 暂无数据 <img alt= "[field:img_txt/]" src= "[field:img_src/]" /> {{xuanlong: if [field:img_txt/]== '玄龙' }} //判断当前图集说明为玄龙时候成立 first--[field:img_txt/] {{xuanlong: else /}} other--[field:img_src/] {{/xuanlong: if }} {/xuanlong:custom} {/xuanlong:list} |
字段说明:
id | 文章ID |
title | 文章标题 |
arcurl | 文章地址 |
litpic | 文章缩略图 |
shorttitle | 短标题 |
keywords | 关键词 |
infos | 简描述【会受到infolen长度影响】 |
description | 简描述 |
typename | 文章所属栏目名称 |
typedir | 文章栏目地址 |
categoryid | 文章所属栏目ID |
writer | 文章作者 |
source | 文章来源 |
senddate | 发布时间 |