phpcms v9调用当前栏目的同级栏目的几种方法

(1)单网页:

{loop $arrchild_arr $cid}<!–只适应用单网页–>
<li {if $catid==$cid}class=”cur_link”{/if}><a href=”{$CATEGORYS[$cid][url]}/”>{$CATEGORYS[$cid][catname]}</a></li>
{/loop}

(2)模型列表页:

{pc:content action=”category” catid=”$parentid” num=”25″ siteid=”$siteid” order=”listorder ASC”}
<ul>
{loop $data $r}
<li {if $catid==$r[catid]}class=”cur_link”{/if}><a href=”{$r[url]}/”>{$r[catname]}</a></li>
{/loop}
</ul>
{/pc}

(3)内容页:

{pc:content action=”category” catid=”$top_parentid” num=”25″ siteid=”$siteid” order=”listorder ASC”}
<ul>
{loop $data $r}
<li {if $catid==$r[catid]}class=”cur_link”{/if}><a href=”{$r[url]}/”>{$r[catname]}</a></li>
{/loop}
</ul>
{/pc}

Published by 小车

网站技术工人