导航栏目
标签名:
{eutoo:1 条件}循环主体 {eutoo:2 条件}  循环主体{/eutoo:2} {/eutoo:1} 可无限嵌套
多重循环特殊标签:
参数名称 示例 要求 说明
classid where="classid='{@classid:1/}'" 可选 多重循环内下级循环调用上级的 classid
clink a href="[clink:2]" 可选 2 表示2级循环内的连接 3 表示3级循环内的连接 依次类推
任何字段名字 {@ClassName:2/} ClassName 可以是任何字段名字 可选 2 表示2级循环内字段 3 表示3级循环内字段 依次类推; 特殊字段写法:{@content:1 fun="delhtml" len="200"/}、{@updatetime:1 date="yyyy-mm-dd"/}
条件:
参数名称 示例 要求 说明
table table="Article_eu" 或 table="1"(里面写模型ID也可以) 可选 数据表,默认不写为当前通用
field field="id,title" (多个字段请用,号分隔,注意,如果循环主体里有字段输出.那么这里必须也要写上) 可选 默认不写为*(查询全部字段)
where where="id=1" 可选 数据库查询条件,默认Article_eu的条件为isAccept=0 and delif=0
top top="10" 可选 默认值为:10,为0时查询全部
order order="id desc" 可选 默认值为:id desc,为 rnd 时为随机显示
countid countid="id" 可选 默认值为:id,主键ID,分页需要用到
sql sql="select * from Article_eu" 必需 默认值为:无,自写SQL
循环主体标签函数:
字段 示例 说明
len {title len="30"} 显示title字段的值,且只显示前30个字符(一个汉字算2个字符)
lenr {title lenr="30"} 显示title字段的值,且只显示后30个字符(一个汉字算2个字符)
replace {title replace="find|repcontent"}。
{title replace="中国|美国"} 通过replace属性替换后输出的结果为:美国人民共和国
{title replace="中国"} 输出结果为:人民共和国
find为查找的值,repcontent为替换值,中间用垂直线分开,若无垂直线,则查找删除符合查询条件的值
none {picurl none="/nopic.gif"} 如果picurl没有内容则显示 /nopic.gif
Before {title Before="你好"} 输出值前插入内容,当title输出值为中国的时候,实际输出的值是: 你好中国
After {title After="你好"} 输出值后插入内容 当title输出值为中国的时候,实际输出的值是: 中国你好
date {UpdateTime date="yyyy-mm-dd"} 其中UpdateTime为字段名且是日期类型,结果举例:2017-10-18,英文月份:{UpdateTime date="yyyy-enm-dd"},结果举例:2017-Oct-18,星期:把日期转化为星期,结果举例:{UpdateTime date="week"} 格式化日期,只适用于日期型字段
fun {title fun="trim"} 是调用ASP函数来对输出结果处理,如果有多个可以用@分开,当然自己也可以在api/public.asp自己根据需要编写
其他标签函数:
字段 说明
[AutoID0] 自增长ID 从0开始 如 0 1 2 3 4 5 6
[AutoID1] 自增长ID 从1开始 如 1 2 3 4 5 6 7
[AutoID2] 自增长ID 从2开始 如 2 3 4 5 6 7
[AutoID00] 偶数自增长ID 从0开始 如 0 2 4 6 8
[AutoID01] 奇数自增长ID 从1开始 如 1 3 5 7 9
[AutoID02] 偶数自增长ID 从2开始 如 2 4 6 8
[ModID] 间歇ID 如 0 1 0 1 交替输出0和1
调用范例一,最简单的调用方法:

  <!--   以下为循环读取 -->

{eutoo:1 table="class_eu" order="Orderid asc,ID asc"  where=" ParentID='0' and dh=1" order="Orderid asc,ID asc"}
<li id="sub_nav[AutoID1:1]">
{eutoo:2 table="class_eu"  where="ParentID='{@classid:1/}' and dh=1"  order="Orderid asc,ID asc"}
<a href="[clink:2]">{@ClassName:2 len="30"/}</a>  时间:{@updatetime:2 date="yyyy-mm-dd"/}
{/eutoo:2} 
</li> 
 {/eutoo:1}

 <!-- 循环结束 -->
输出后:
  <!--   以下为循环读取 -->
<li id="sub_nav1">
    <a href="/html/biaoti1.11html">标题111</a> 时间:2018-04-27
    <a href="/html/biaoti1.11html">标题111</a> 时间:2018-04-27
</li>
<li id="sub_nav2">
    <a href="/html/biaoti222.html>标题222</a> 时间:2018-04-27
    <a href="/html/biaoti222.html>标题222</a> 时间:2018-04-27
</li>
	......................
   <!-- 循环结束 -->