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

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% block stylesheet %}
  9.     <link rel="stylesheet" href="/html/user_data/assets/css/category_nav.css">
  10. {% endblock %}
  11. {% set Categories = repository('Eccube\\Entity\\Category').getList() %}
  12. {% macro tree(Category) %}
  13.     {% from _self import tree %}
  14.     <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
  15.         {{ Category.name }}
  16.     </a>
  17.     {% if Category.children|length > 0 %}
  18.         <ul>
  19.             {% for ChildCategory in Category.children %}
  20.                 <li>
  21.                     {{ tree(ChildCategory) }}
  22.                 </li>
  23.             {% endfor %}
  24.         </ul>
  25.     {% endif %}
  26. {% endmacro %}
  27. {# @see https://github.com/bolt/bolt/pull/2388 #}
  28. {% from _self import tree %}
  29. <div class="ec-categoryNaviRole">
  30.     <div class="ec-itemNav">
  31.         <ul class="ec-itemNav__nav">
  32.             {% for Category in Categories %}
  33.                 <li>
  34.                     {{ tree(Category) }}
  35.                 </li>
  36.             {% endfor %}
  37.         </ul>
  38.     </div>
  39. </div>