//获取一级分类
<div> <!-- loop from=$list.tree key=$key value=$value id=list_id --> <a href="{$value.url}" {if $cate_rs.identifier==$value.identifier||$cate_rs.parent_id==$value.id} class="current"{/if}>{$value.title}</a> <!-- /loop --> </div> <div> //获取二级分类 <!-- loop from=$list.tree key=$key value=$value id=list_id --> {if $cate_rs.identifier==$value.identifier||$cate_rs.parent_id==$value.id} <!-- loop from=$value.sublist key=$k value=$v --> <a href="{$v.url}" {if $cate_rs.identifier==$v.identifier} class="current"{/if}>{$v.title}</a> <!-- /loop --> {/if} <!-- /loop --> </div>
//获取品牌 参照 https://www.phpok.com/multiple-attribute-filter.html <div> <!-- loop from=$filter key=$key value=$value id=$tmpid --> {if $value.title==‘品牌‘} (title根据项目名称) <!-- loop from=$value.list key=$k value=$v id=$tmpid2 --> <a href="{$v.url}" {if $v.highlight} class="current"{/if}>{func phpok_cut $v.title 15 …}</a> <!-- /loop --> {/if} <!-- /loop --> </div>
原文:https://www.cnblogs.com/jimz/p/9292263.html