
使用IF语句每篇内容标题不同效果的列表
点击数:
模版代码
<CMS action="LIST" return="List" NodeID="7" Num="10" /> <loop name="List" key="key" var="var" start="1"> <if test="$key == 1"> <h3>[$var.Title]</h3> <elseif test="$key == 2 || $key == 3 || $key == 4 "> [<span> <a href="#">[$var.Title]</a> </span>] <else> <span><a href="#">[$var.Title]</a></span> </if> </loop>
CSS
body{
font-size:12px;
}
h3{
color:#FF0000;
margin:0px;
}
a{
text-decoration:none;
}
a:hover{
text-decoration:underline;
}