丝袜av在线观看|日本美女三级片在线播放|性欧美一区二区三区|小骚热免费国产视频|黑人va在线观看|女同国产91视频|五月丁香色播Av|国产凸凹视频一区二区|伊人电影久久99|国产成人无码一区二区观看

導航列表標簽

說明:用于獲取頁面導航列表

使用方法: {% navList 變量名稱 %} 如將變量定義為navs {% navList navs %}...{% endnavList %},也可以定義為其他變量名稱,定義后,需要與下面的for循環(huán)使用的變量名稱一致。

navList 支持的參數(shù)有

  • 導航列表ID typeId typeId 為后臺的導航類別ID,默認 typeId=1,如果后臺設(shè)置了多個導航類別,可以通過typeId 來指定調(diào)用。
  • 站點ID siteId siteId 一般不需要填寫,如果你使用后臺的多站點管理創(chuàng)建了多個站點,并且想調(diào)用其他站點的數(shù)據(jù),則可以通過指定 siteId 來實現(xiàn)調(diào)用指定站點的數(shù)據(jù)。

navList 需要使用使用 endnavList 標簽表示結(jié)束,中間使用for循環(huán)輸出內(nèi)容。

navs 是一個數(shù)組對象,因此需要使用 for 循環(huán)來輸出

item 為for循環(huán)體內(nèi)的變量,可用的字段有:

  • 導航標題 Title
  • 子標題 SubTitle
  • 導航描述 Description
  • 導航鏈接 Link
  • 對應(yīng)分類ID PageId 如果這個導航菜單是選擇了分類的話,則存在
  • 是否當前鏈接 IsCurrent
  • 下級導航列表 NavList 下級導航內(nèi)同樣具有 item 相同的字段。

代碼示例

{% navList navs %}
<ul>
    {%- for item in navs %}
        <li class="{% if item.IsCurrent %}active{% endif %}">
            <a href="{{ item.Link }}">{{item.Title}}</a>
            {%- if item.NavList %}
            <dl>
                {%- for inner in item.NavList %}
                    <dd class="{% if inner.IsCurrent %}active{% endif %}">
                        <a href="{{ inner.Link }}">{{inner.Title}}</a>
                    </dd>
                {% endfor %}
            </dl>
            {% endif %}
        </li>
    {% endfor %}
</ul>
{% endnavList %}

常見使用實例

  1. 在導航上顯示下拉分類,并且在分類下顯示產(chǎn)品文檔。如圖:

image image

調(diào)用代碼示例,該調(diào)用需要在后臺已經(jīng)設(shè)置好二級導航的基礎(chǔ)上(代碼不包含css樣式控制)

<ul>
    {% navList navList with typeId=1 %}
    {%- for item in navList %}
    <li>
        <a href="{{ item.Link }}">{{item.Title}}</a>
        {%- if item.NavList %}
        <ul class="nav-menu-child">
            {%- for inner in item.NavList %}
            <li>
                <a href="{{ inner.Link }}">{{inner.Title}}</a>
                {% archiveList products with type="list" categoryId=inner.PageId limit="8" %}
                {% if products %}
                <ul class="nav-menu-child-child">
                    {% for item in products %}
                    <li><a href="{{item.Link}}">{{item.Title}}</a></li>
                    {% endfor %}
                </ul>
                {% endif %}
                {% endarchiveList %}
            </li>
            {% endfor %}
        </ul>
        {% endif %}
    </li>
    {% endfor %}
    {% endnavList %}
</ul>
  1. 在導航上顯示下拉分類,并且在分類下顯示它的下級分類,如果沒有則不顯示。如圖: image

調(diào)用代碼示例,該調(diào)用需要在后臺已經(jīng)設(shè)置好二級導航的基礎(chǔ)上(代碼不包含css樣式控制)

<ul>
    {% navList navList with typeId=1 %}
    {%- for item in navList %}
    <li>
        <a href="{{ item.Link }}">{{item.Title}}</a>
        {%- if item.NavList %}
        <ul class="nav-menu-child">
            {%- for inner in item.NavList %}
            <li>
                <a href="{{ inner.Link }}">{{inner.Title}}</a>
                {% if inner.PageId > 0 %}
                    {% categoryList categories with parentId=inner.PageId %}
                    {% if categories %}
                    <ul>
                        {% for item in categories %}
                        <li>
                            <a href="{{ item.Link }}">{{item.Title}}</a>
                        </li>
                        {% endfor %}
                    </ul>
                    {% endif %}
                    {% endcategoryList %}
                {% endif %}
            </li>
            {% endfor %}
        </ul>
        {% endif %}
    </li>
    {% endfor %}
    {% endnavList %}
</ul>
問題反饋可加技術(shù)微信:tsrz001
目錄