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. {% set Categories = repository('Eccube\\Entity\\Category').getList() %}
  9. {% macro tree(Category) %}
  10.     {% from _self import tree %}
  11.     {% if Category.id != 7 %}
  12.         <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
  13.             {{ Category.name }}<!--カテゴリ―反映-->
  14.         </a>
  15.         {% if Category.children|length > 0 %}
  16.             <ul>
  17.                 {% for ChildCategory in Category.children %}
  18.                     <li>
  19.                         {{ tree(ChildCategory) }}
  20.                     </li>
  21.                 {% endfor %}
  22.             </ul>
  23.         {% endif %}
  24.     {% endif %}
  25. {% endmacro %}
  26. {# @see https://github.com/bolt/bolt/pull/2388 #}
  27. {% from _self import tree %}
  28. <div class="ec-categoryNaviRole">
  29.     <div class="ec-itemNav">
  30.         <ul class="ec-itemNav__nav">
  31.             {% for Category in Categories %}
  32.                 <li>
  33.                     {{ tree(Category) }}
  34.                 </li>
  35.             {% endfor %}
  36.         </ul>
  37.     </div>
  38. </div>