app/template/meldiastore/Block/category_nav_sp.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. {% set Categories = repository('Eccube\\Entity\\Category').getList() %}
  9. {% macro tree(Category) %}
  10.     {% from _self import tree %}
  11.     {% if Category.children|length > 0 %}
  12.         <div class="b-category-nav-sp__contents">
  13.             <div class="b-category-nav-sp__heading js-category-nav-sp__heading">
  14.                 <div class="b-category-nav-sp__heading-contents">
  15.                     <span class="b-category-nav-sp__name">{{ Category.name }}</span>
  16.                     <i class="b-category-nav-sp__icon c-animation--rotate-forward material-icons">expand_more</i>
  17.                 </div>
  18.             </div>
  19.             <ul class="b-category-nav-sp__list u-list-sanitize js-category-nav-sp__list">
  20.                 <li class="b-category-nav-sp__list-item">
  21.                     <a href="{{ url('product_list') }}?category_id={{ Category.id }}" class="b-category-nav-sp__link js-category-nav-sp__link">
  22.                         <span class="b-category-nav-sp__name">すべて</span>
  23.                     </a>
  24.                 </li>
  25.                 {% for ChildCategory in Category.children %}
  26.                     <li class="b-category-nav-sp__list-item">
  27.                         {{ tree(ChildCategory) }}
  28.                     </li>
  29.                 {% endfor %}
  30.             </ul>
  31.         </div>
  32.     {% else %}
  33.         <a class="b-category-nav-sp__link" href="{{ url('product_list') }}?category_id={{ Category.id }}">
  34.             <span class="b-category-nav-sp__name">{{ Category.name }}</span>
  35.         </a>
  36.     {% endif %}
  37. {% endmacro %}
  38. {# @see https://github.com/bolt/bolt/pull/2388 #}
  39. {% from _self import tree %}
  40. <nav class="b-category-nav-sp">
  41.     <ul class="b-category-nav-sp__list u-list-sanitize js-category-nav-sp__list">
  42.         {% for Category in Categories %}
  43.             <li class="b-category-nav-sp__list-item">
  44.                 {{ tree(Category) }}
  45.             </li>
  46.         {% endfor %}
  47.     </ul>
  48. </nav>