phpcms v9 if语句的一些常用方法
来源: 点击: 日期:2015-09-13 17:45:05
phpcms v9栏目选中特效:
- {pc:content action="category" catid="0" num="25" siteid="$siteid" order="listorder ASC"}
- {loop $data $r}
- {$r[catname]}
- {/loop}
- {/pc}
封面页,列表页以及内容页经常会用到:
- {if $parentid}{$CATEGORYS[$CAT[parentid]][catname]}{else}{$CAT[catname]}{/if}
封面页,列表页以及内容页调用子栏目的时候经常用到:
- {if $top_parentid}
- {pc:content action="category" catid="$top_parentid" siteid="$siteid" order="listorder ASC"}
- {else}
- {pc:content action="category" catid="$catid" siteid="$siteid" order="listorder ASC"}
- {/if}
- {loop $data $r}
-
- {$r[catname]}
-
- {/loop}
- {/pc}