{#
temptu-style: グローバルメニュー(8項目・各クリックで子メニュー表示)
各項目の子メニューはカテゴリIDで指定。空の場合は「全ての商品」のみ。
#}
{% set menu_items = [
{ label: 'AIRBRUSH', ids: [7, 8, 9, 10, 20] },
{ label: 'FACE & BODY', ids: [22, 15, 14, 27, 30] },
{ label: 'SPECIAL FX', ids: [18] },
{ label: 'SCULPTING & MOLDING', ids: [19] },
{ label: 'COVER', ids: [16, 26] },
{ label: 'BEAUTY', ids: [] },
{ label: 'TEXTBOOK', ids: [21] },
{ label: 'SALE', ids: [535, 536, 537] }
] %}
<nav class="ec-headerNavMain">
<ul class="ec-headerNavMain__list">
{% for item in menu_items %}
<li class="ec-headerNavMain__item ec-headerNavMain__item--hasDropdown" data-nav-dropdown>
<a href="{{ url('product_list') }}" class="ec-headerNavMain__link ec-headerNavMain__link--dropdown" aria-haspopup="true" aria-expanded="false">{{ item.label }}<i class="fas fa-chevron-down ec-headerNavMain__chevron" aria-hidden="true"></i></a>
<ul class="ec-headerNavMain__dropdown">
{% set sub_categories = item.ids is empty ? [] : categories_by_ids(item.ids) %}
{% if sub_categories|length > 0 %}
{% for Category in sub_categories %}
<li class="ec-headerNavMain__dropdownItem">
<a href="{{ url('product_list') }}?category_id={{ Category.id }}">{{ Category.name }}</a>
{% if Category.children|length > 0 %}
<ul class="ec-headerNavMain__sub">
{% for Child in Category.children %}
<li><a href="{{ url('product_list') }}?category_id={{ Child.id }}">{{ Child.name }}</a></li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
{% endif %}
</ul>
</li>
{% endfor %}
</ul>
</nav>