app/template/default/Block/category_nav_pc.twig line 1

Open in your IDE?
  1. {#
    This file is part of EC-CUBE
    
    Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
    
    http://www.ec-cube.co.jp/
    
    For the full copyright and license information, please view the LICENSE
    file that was distributed with this source code.
    #}
    {% set Categories = repository('Eccube\\Entity\\Category').getList() %}
    
    {% macro tree(Category) %}
        {% from _self import tree %}
        <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
            {{ Category.name }}
        </a>
        {% if Category.children|length > 0 %}
            <ul>
                {% for ChildCategory in Category.children %}
                    <li>
                        {{ tree(ChildCategory) }}
                    </li>
                {% endfor %}
            </ul>
        {% endif %}
    {% endmacro %}
    
    {% macro tree2(Category) %}
        {% from _self import tree %}
        <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
            {{ Category.name }}
        </a>
        {% if Category.children|length > 0 %}
            <ul class="navi_items">
                {% for ChildCategory in Category.children %}
                    <li>
                        {{ tree(ChildCategory) }}
                    </li>
                {% endfor %}
            </ul>
        {% endif %}
    {% endmacro %}
    
    {# @see https://github.com/bolt/bolt/pull/2388 #}
    {% from _self import tree %}
    {% from _self import tree2 %}
    
    <div class="ec-categoryNaviRole">
        <div class="ec-itemNav">
            <ul class="ec-itemNav__nav">
                <li><a href="{{ url(eccube_config.eccube_user_data_route, {'route': 'about'}) }}">{{ 'ゆばのお話'|trans }}</a></li>
                <li><a href="{{ url(eccube_config.eccube_user_data_route, {'route': 'yubahachi'}) }}">{{ 'ゆば八のこだわり'|trans }}</a></li>
                <li>
                    <a href="{{ url('product_list') }}">{{ '商品一覧'|trans }}</a>
                    <ul class="navi_items">
                        <li>
                            <a href="{{ url('product_list') }}">{{ 'すべての商品'|trans }}</a>
                        </li>
                        {% for Category in Categories %}
                            {% if Category.id != 26 and Category.id != 31 and Category.id != 32 %}
                                <li>
                                    {{ tree(Category) }}
                                </li>
                            {% endif %}
                        {% endfor %}
                    </ul>
                </li>
                <li>
                    {% for Category in Categories %}
                        {% if Category.id == 26 %}
                            {{ tree2(Category) }}
                        {% endif %}
                    {% endfor %}
                </li>
                <li>
                    {% for Category in Categories %}
                        {% if Category.id == 31 %}
                            {{ tree2(Category) }}
                        {% endif %}
                    {% endfor %}
                </li>
                <li>
                    {% for Category in Categories %}
                        {% if Category.id == 32 %}
                            {{ tree2(Category) }}
                        {% endif %}
                    {% endfor %}
                </li>
    {#
                <li><a href="/blog/?categories%5B0%5D=1">ゆばのある暮らし</a></li>
    #}
                <li><a href="/blog/?categories%5B0%5D=4">ゆばレシピ</a></li>
                <li><a href="{{ url('help_about') }}">{{ '店舗情報'|trans }}</a></li>
                <li><a href="https://pro.hieiyuba.jp/">卸ご希望の方へ</a></li>
            </ul>
        </div>
    </div>