app/template/iizukanew/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.     <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
  12.         {{ Category.name }}
  13.     </a>
  14.     {% if Category.children|length > 0 %}
  15.         <ul>
  16.             {% for ChildCategory in Category.children %}
  17.                 <li>
  18.                     {{ tree(ChildCategory) }}
  19.                 </li>
  20.             {% endfor %}
  21.         </ul>
  22.     {% endif %}
  23. {% endmacro %}
  24. {# @see https://github.com/bolt/bolt/pull/2388 #}
  25. {% from _self import tree %}
  26. <div class="ec-categoryNaviRole">
  27.     <div class="ec-itemNav">
  28.         <ul class="ec-itemNav__nav">
  29.             <li>
  30.                 <a href="{{ url('product_list') }}">全商品</a>
  31.             </li>
  32.             <!-- カテゴリが多いため、カテゴリ一覧の上位3のみを表示するカスタマイズ-->
  33.             {% set breakLoop = false %}
  34.             {% set roop_count = 0 %}
  35.             {% for Category in Categories if breakLoop == false %}
  36.                 <li>
  37.                     {{ tree(Category) }}
  38.                 </li>
  39.                 {% set roop_count = roop_count + 1 %}
  40.                 {% if roop_count > 2 %}
  41.                     {% set breakLoop = true %}
  42.                 {% endif %}
  43.                 <!--カスタマイズここまで-->
  44.             {% endfor %}
  45.             <li>
  46.                 <a href="{{ url('feature_detail', {'url': 'souryou_muryou'}) }}">お得なメール便</a>
  47.             </li>
  48.             <li>
  49.                 <a class="target-link" href="https://www.iizuka-nori.co.jp/column/" target="_blank">コラム</a>
  50.             </li>
  51.         </ul>
  52.     </div>
  53. </div>