app/template/bootcube/Block/category_list_1.twig line 1

Open in your IDE?
  1. {% set CategoryList = repository('Eccube\\Entity\\Category').getList() %}
  2. <section class="mb-8">
  3.   <div class="section_header">
  4.     <div class="d-flex align-items-end pb-3 bdb">
  5.       <h1 class="title m-0 fz-6">Category</h1>
  6.     </div>
  7.   </div>
  8.   <div class="section_body">
  9.     <nav>
  10.       <ul class="nav flex-column">
  11.         {% for Category in CategoryList %}
  12.         <li>
  13.           <a class="d-block py-2" href="{{ url('product_list') }}?category_id={{ Category.id }}">{{ Category.name }}</a>
  14.           {% if Category.children|length > 0 %}
  15.             <ul class="nav flex-column mt-0 pl-3">
  16.               {% for ChildCategory in Category.children %}
  17.                 <li>
  18.                   <a class="d-block py-2" href="{{ url('product_list') }}?category_id={{ ChildCategory.id }}">{{ ChildCategory.name }}</a>
  19.                 </li>
  20.               {% endfor %}
  21.             </ul>
  22.           {% endif %}
  23.         </li>
  24.         {% endfor %}
  25.       </ul>
  26.     </nav>
  27.   </div>
  28. </section>