dede織夢判斷導航欄是否有子欄目

如下代碼判斷導航欄是否含有子欄目

{dede:field name=typeid runphp="yes"} global $dsql; $sql = "SELECT id From `dme_arctype` WHERE reid='@me' And ishidden<>1 order by sortrank asc limit 0, 100 "; $row = $dsql->GetOne($sql); $res = is_array($row)?'<div class="navCMC-slide"><div class="navCMC-slide-container"><ul class="navCMC-cat2">':''; @me=$res; {/dede:field} {dede:channel type='sun' sanji='1' noself='yes'} <li class="navCMC-cat2-title col-md-3">
        <a href="[field:typelink/]">[field:typename/]</a>
            <ul> {dede:arclist row='3' titlelen='14'} <li>
                    <a href="{field:arcurl/}">{field:title/}</a>
                </li> {/dede:arclist} </ul>
    </li> {/dede:channel} {dede:field name=typeid runphp="yes"} global $dsql; $sql = "SELECT id From `dme_arctype` WHERE reid='@me' And ishidden<>1 order by sortrank asc limit 0, 100 "; $row = $dsql->GetOne($sql); $res=is_array($row)?'</ul></div></div>':''; @me=$res; {/dede:field}

{dede:channel type='son' noself='yes'}關閉無子欄目時取同級欄目

相關文章
相關標籤/搜索