{dede:php}
$GLOBALS['thisid'] = intval($refObj->Fields['id']);
{/dede:php}
<ul>
<li><a href="/" target="_blank" {dede:php} if(!$GLOBALS['thisid']) echo "class='this'"; {/dede:php} ><span>HOME</span><br />首 頁(yè)</a></li>
{dede:channel type='top' row='7' }
<li><a href="[field:typeurl/]" [field:id runphp='yes'] if (@me == $GLOBALS['thisid'] ) @me = "class='this' " ;[/field:id] target="_blank" ><span>[field:alias/]</span><br />[field:typename/]</a></li>
{/dede:channel}
</ul>
?{dede:php} ?$GLOBALS['thisid'] = intval($refObj->Fields['id']); {/dede:php}?
獲取當(dāng)前欄目ID。
[field:id runphp='yes'] if (@me == $GLOBALS['thisid'] ) @me = "class='this' " ;[/field:id]?
對(duì)dede:channel標(biāo)簽運(yùn)行PHP,如果ID相等,輸出class='this'