可以放在style.html 模板里面
{foreach $classtypedata as $v} {if($v['pid']==0 && isset($type) && in_array($type['id'],$v['children']['ids']) )} {php $topid = $v['id']; /} {/if} {/foreach}
其他页面引用
{$topid}
获取当前顶级栏目的banner图
<div id="banIn" style="background-image: url({$classtypedata[$pid]['litpic']})"> </div>