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

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
  4. http://www.lockon.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. {#
  9. {% set Categories = repository('Eccube\\Entity\\Category').getList() %}
  10. {% macro tree(Category) %}
  11.     {% from _self import tree %}
  12.     {% if Category.children|length > 0 %}
  13.         <div class="b-category-nav-pc__contents">
  14.             <div class="b-category-nav-pc__heading js-category-nav-sp__heading mdc-ripple-surface">
  15.                 <div class="b-category-nav-pc__heading-contents">
  16.                     <span class="b-category-nav-pc__name">{{ Category.name }}</span>
  17.                     <i class="b-category-nav-pc__icon c-animation--rotate-forward fas fa-angle-down"></i>
  18.                 </div>
  19.             </div>
  20.             <ul class="b-category-nav-pc__list u-list-sanitize js-category-nav-sp__list">
  21.                 <li class="b-category-nav-pc__list-item">
  22.                     <a href="{{ url('product_list') }}?category_id={{ Category.id }}" class="b-category-nav-pc__link js-category-nav-sp__link">
  23.                         <span class="b-category-nav-pc__name">すべて</span>
  24.                     </a>
  25.                 </li>
  26.                 {% for ChildCategory in Category.children %}
  27.                     <li class="b-category-nav-pc__list-item">
  28.                         {{ tree(ChildCategory) }}
  29.                     </li>
  30.                 {% endfor %}
  31.             </ul>
  32.         </div>
  33.     {% else %}
  34.         <a class="b-category-nav-pc__link" href="{{ url('product_list') }}?category_id={{ Category.id }}">
  35.             <span class="b-category-nav-pc__name">{{ Category.name }}</span>
  36.         </a>
  37.     {% endif %}
  38. {% endmacro %}
  39. #}
  40. {# @see https://github.com/bolt/bolt/pull/2388 #}
  41. {#
  42. {% from _self import tree %}
  43. <nav class="b-category-nav-pc">
  44.     <ul class="b-category-nav-pc__list u-list-sanitize js-category-nav-sp__list">
  45.         {% for Category in Categories %}
  46.             <li class="b-category-nav-pc__list-item">
  47.                 {{ tree(Category) }}
  48.             </li>
  49.         {% endfor %}
  50.     </ul>
  51. </nav>
  52. #}