pbootcms模板內頁呼叫子欄目,如果沒有子欄目則呼叫同級欄目

黄文Rex發表於2024-10-04
{pboot:if('{pboot:nav parent={sort:scode}}[nav:name]{/pboot:nav}'!='')}   
    {pboot:nav parent={sort:scode}}
    <div class="pro_div"> <a class="item fl {pboot:2if('[nav:scode]'=='{sort:scode}')}on{/pboot:2if} " href="[nav:link]">[nav:name]</a> </div>
    {/pboot:nav}
{else}
    {pboot:nav parent={sort:pcode}}
    <div class="pro_div"> <a class="item fl {pboot:2if('[nav:scode]'=='{sort:scode}')}on{/pboot:2if} " href="[nav:link]">[nav:name]</a> </div>
    {/pboot:nav}
{/pboot:if}

相關文章