当前位置: 首页>网络资讯 > 网站建设 >

phpcms v9 if语句的一些常用方法

来源:    点击:    日期:2015-09-13 17:45:05

phpcms v9栏目选中特效:
  1. {pc:content action="category" catid="0" num="25" siteid="$siteid" order="listorder ASC"}
  2. {loop $data $r}
  3.    {$r[catname]}
  4.    {/loop}
  5.    {/pc}
封面页,列表页以及内容页经常会用到:
  1. {if $parentid}{$CATEGORYS[$CAT[parentid]][catname]}{else}{$CAT[catname]}{/if}

封面页,列表页以及内容页调用子栏目的时候经常用到:
  1. {if $top_parentid}
  2. {pc:content action="category" catid="$top_parentid" siteid="$siteid" order="listorder ASC"}
  3. {else}
  4. {pc:content action="category" catid="$catid" siteid="$siteid" order="listorder ASC"}
  5. {/if}
  6. {loop $data $r}
  7.  
  8. {$r[catname]}
  9.  
  10. {/loop}
  11. {/pc}