src/Eccube/Resource/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. {% block javascript %}
  9. {# <script type="text/javascript">
  10. const sidebarSetting = () => {
  11.     const header = document.querySelector('header');
  12.     const headerHeight = header.clientHeight;
  13.     var sidebar = new StickySidebar('.sidebar-sticky', { // 追従させる要素
  14.         containerSelector: '.ec-layoutRole__contents', // 親要素
  15.         innerWrapperSelector: '.sidebar', // 追従させる要素のインナー要素
  16.         topSpacing: 0
  17.     });
  18. }
  19. window.addEventListener('resize', sidebarSetting);
  20. window.addEventListener('load', sidebarSetting);
  21. </script> #}
  22. {% endblock %}
  23. {% set Categories = repository('Eccube\\Entity\\Category').getList() %}
  24. {% macro tree(Category) %}
  25.     {% from _self import tree %}
  26.     <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
  27.         {{ Category.name }}
  28.     </a>
  29.     {% if Category.children|length > 0 %}
  30.         <ul>
  31.             {% for ChildCategory in Category.children %}
  32.                 <li>
  33.                     {{ tree(ChildCategory) }}
  34.                 </li>
  35.             {% endfor %}
  36.         </ul>
  37.     {% endif %}
  38. {% endmacro %}
  39. {# @see https://github.com/bolt/bolt/pull/2388 #}
  40. {% from _self import tree %}
  41. {# <div class="sidebar">
  42.     <div class="sidebar_inner">
  43.         <p class="sidebar_lead">カテゴリから探す</p>
  44.         <ul class="">
  45.             {% for Category in Categories %}
  46.                 <li>
  47.                     {{ tree(Category) }}
  48.                 </li>
  49.             {% endfor %}
  50.         </ul>
  51.     </div>
  52. </div> #}
  53. <div class="sidebar">
  54.     <div class="sidebar_inner">
  55.         <p class="sidebar_lead">カテゴリから探す</p>
  56.         <ul class="sidebar_list">
  57.             <li class="sidebar_list_item">
  58.                 <a href="" class="sidebar_list_target">BP商材その他</a>
  59.                 <div class="sidebar_box">
  60.                     <div class="sidebar_box_navi">
  61.                         <a href="" class="sidebar_box_link">BP商材その他</a>
  62.                         <ul class="sidebar_box_child">
  63.                             <li class="sidebar_box_child_item">
  64.                                 <a href="" class="sidebar_box_link">その他</a>
  65.                             </li>
  66.                         </ul>
  67.                     </div>
  68.                     <picture class="sidebar_box_image">
  69.                         <img src="{{ asset('assets/img/common/category/sample01.jpg', 'user_data') }}" alt="">
  70.                     </picture>
  71.                 </div>
  72.             </li>
  73.             <li class="sidebar_list_item">
  74.                 <a href="" class="sidebar_list_target">電装その他</a>
  75.                 <div class="sidebar_box">
  76.                     <div class="sidebar_box_navi">
  77.                         <a href="" class="sidebar_box_link">電装その他</a>
  78.                         <ul class="sidebar_box_child">
  79.                             <li class="sidebar_box_child_item">
  80.                                 <a href="" class="sidebar_box_link">電装その他</a>
  81.                             </li>
  82.                         </ul>
  83.                     </div>
  84.                     <picture class="sidebar_box_image">
  85.                         <img src="{{ asset('assets/img/common/category/sample02.jpg', 'user_data') }}" alt="">
  86.                     </picture>
  87.                 </div>
  88.             </li>
  89.             <li class="sidebar_list_item">
  90.                 <a href="" class="sidebar_list_target">電装バルブ</a>
  91.                 <div class="sidebar_box">
  92.                     <div class="sidebar_box_navi">
  93.                         <a href="" class="sidebar_box_link">電装バルブ</a>
  94.                         <ul class="sidebar_box_child">
  95.                             <li class="sidebar_box_child_item">
  96.                                 <a href="" class="sidebar_box_link">バルブ</a>
  97.                             </li>
  98.                         </ul>
  99.                     </div>
  100.                     <picture class="sidebar_box_image">
  101.                         <img src="{{ asset('assets/img/common/category/sample03.jpg', 'user_data') }}" alt="">
  102.                     </picture>
  103.                 </div>
  104.             </li>
  105.             <li class="sidebar_list_item">
  106.                 <a href="" class="sidebar_list_target">電装ヒューズ</a>
  107.                 <div class="sidebar_box">
  108.                     <div class="sidebar_box_navi">
  109.                         <a href="" class="sidebar_box_link">電装ヒューズ</a>
  110.                         <ul class="sidebar_box_child">
  111.                             <li class="sidebar_box_child_item">
  112.                                 <a href="" class="sidebar_box_link">ヒューズ</a>
  113.                             </li>
  114.                         </ul>
  115.                     </div>
  116.                     <picture class="sidebar_box_image">
  117.                         <img src="{{ asset('assets/img/common/category/sample04.jpg', 'user_data') }}" alt="">
  118.                     </picture>
  119.                 </div>
  120.             </li>
  121.             <li class="sidebar_list_item">
  122.                 <a href="" class="sidebar_list_target">工具類その他</a>
  123.                 <div class="sidebar_box">
  124.                     <div class="sidebar_box_navi">
  125.                         <a href="" class="sidebar_box_link">工具類その他</a>
  126.                         <ul class="sidebar_box_child">
  127.                             <li class="sidebar_box_child_item">
  128.                                 <a href="" class="sidebar_box_link">その他</a>
  129.                             </li>
  130.                         </ul>
  131.                     </div>
  132.                     <picture class="sidebar_box_image">
  133.                         <img src="{{ asset('assets/img/common/category/sample05.jpg', 'user_data') }}" alt="">
  134.                     </picture>
  135.                 </div>
  136.             </li>
  137.             <li class="sidebar_list_item">
  138.                 <a href="" class="sidebar_list_target">整備商材その他</a>
  139.                 <div class="sidebar_box">
  140.                     <div class="sidebar_box_navi">
  141.                         <a href="" class="sidebar_box_link">整備商材その他</a>
  142.                         <ul class="sidebar_box_child">
  143.                             <li class="sidebar_box_child_item">
  144.                                 <a href="" class="sidebar_box_link">その他</a>
  145.                             </li>
  146.                         </ul>
  147.                     </div>
  148.                     <picture class="sidebar_box_image">
  149.                         <img src="{{ asset('assets/img/common/category/sample06.jpg', 'user_data') }}" alt="">
  150.                     </picture>
  151.                 </div>
  152.             </li>
  153.             <li class="sidebar_list_item">
  154.                 <a href="" class="sidebar_list_target">その他その他</a>
  155.                 <div class="sidebar_box">
  156.                     <div class="sidebar_box_navi">
  157.                         <a href="" class="sidebar_box_link">その他その他</a>
  158.                         <ul class="sidebar_box_child">
  159.                             <li class="sidebar_box_child_item">
  160.                                 <a href="" class="sidebar_box_link">その他</a>
  161.                             </li>
  162.                         </ul>
  163.                     </div>
  164.                     <picture class="sidebar_box_image">
  165.                         <img src="{{ asset('assets/img/common/category/sample01.jpg', 'user_data') }}" alt="">
  166.                     </picture>
  167.                 </div>
  168.             </li>
  169.             <li class="sidebar_list_item">
  170.                 <a href="" class="sidebar_list_target">その他部材</a>
  171.                 <div class="sidebar_box">
  172.                     <div class="sidebar_box_navi">
  173.                         <a href="" class="sidebar_box_link">その他部材</a>
  174.                         <ul class="sidebar_box_child">
  175.                             <li class="sidebar_box_child_item">
  176.                                 <a href="" class="sidebar_box_link">部材</a>
  177.                             </li>
  178.                         </ul>
  179.                     </div>
  180.                     <picture class="sidebar_box_image">
  181.                         <img src="{{ asset('assets/img/common/category/sample02.jpg', 'user_data') }}" alt="">
  182.                     </picture>
  183.                 </div>
  184.             </li>
  185.             <li class="sidebar_list_item">
  186.                 <a href="" class="sidebar_list_target">その他用品</a>
  187.                 <div class="sidebar_box">
  188.                     <div class="sidebar_box_navi">
  189.                         <a href="" class="sidebar_box_link">その他用品</a>
  190.                         <ul class="sidebar_box_child">
  191.                             <li class="sidebar_box_child_item">
  192.                                 <a href="" class="sidebar_box_link">用品</a>
  193.                             </li>
  194.                         </ul>
  195.                     </div>
  196.                     <picture class="sidebar_box_image">
  197.                         <img src="{{ asset('assets/img/common/category/sample03.jpg', 'user_data') }}" alt="">
  198.                     </picture>
  199.                 </div>
  200.             </li>
  201.             <li class="sidebar_list_item">
  202.                 <a href="" class="sidebar_list_target">タイヤ</a>
  203.                 <div class="sidebar_box">
  204.                     <div class="sidebar_box_navi">
  205.                         <a href="" class="sidebar_box_link">タイヤ</a>
  206.                         <ul class="sidebar_box_child">
  207.                             <li class="sidebar_box_child_item">
  208.                                 <a href="" class="sidebar_box_link">夏タイヤ</a>
  209.                             </li>
  210.                             <li class="sidebar_box_child_item">
  211.                                 <a href="" class="sidebar_box_link">スタッドレス</a>
  212.                             </li>
  213.                             <li class="sidebar_box_child_item">
  214.                                 <a href="" class="sidebar_box_link">オールシーズン</a>
  215.                             </li>
  216.                             <li class="sidebar_box_child_item">
  217.                                 <a href="" class="sidebar_box_link">スタッドレスホイルセット</a>
  218.                             </li>
  219.                         </ul>
  220.                     </div>
  221.                     <picture class="sidebar_box_image">
  222.                         <img src="{{ asset('assets/img/common/category/sample04.jpg', 'user_data') }}" alt="">
  223.                     </picture>
  224.                 </div>
  225.             </li>
  226.             <li class="sidebar_list_item">
  227.                 <a href="" class="sidebar_list_target">タイヤ周辺機材</a>
  228.                 <div class="sidebar_box">
  229.                     <div class="sidebar_box_navi">
  230.                         <a href="" class="sidebar_box_link">タイヤ周辺機材</a>
  231.                         <ul class="sidebar_box_child">
  232.                             <li class="sidebar_box_child_item">
  233.                                 <a href="" class="sidebar_box_link">貼り付けウエイト</a>
  234.                             </li>
  235.                             <li class="sidebar_box_child_item">
  236.                                 <a href="" class="sidebar_box_link">袋ナット</a>
  237.                             </li>
  238.                         </ul>
  239.                     </div>
  240.                     <picture class="sidebar_box_image">
  241.                         <img src="{{ asset('assets/img/common/category/sample05.jpg', 'user_data') }}" alt="">
  242.                     </picture>
  243.                 </div>
  244.             </li>
  245.             <li class="sidebar_list_item">
  246.                 <a href="" class="sidebar_list_target">電装品</a>
  247.                 <div class="sidebar_box">
  248.                     <div class="sidebar_box_navi">
  249.                         <a href="" class="sidebar_box_link">電装品</a>
  250.                         <ul class="sidebar_box_child">
  251.                             <li class="sidebar_box_child_item">
  252.                                 <a href="" class="sidebar_box_link">ドラレコ</a>
  253.                             </li>
  254.                             <li class="sidebar_box_child_item">
  255.                                 <a href="" class="sidebar_box_link">ETC</a>
  256.                             </li>
  257.                         </ul>
  258.                     </div>
  259.                     <picture class="sidebar_box_image">
  260.                         <img src="{{ asset('assets/img/common/category/sample06.jpg', 'user_data') }}" alt="">
  261.                     </picture>
  262.                 </div>
  263.             </li>
  264.             <li class="sidebar_list_item">
  265.                 <a href="" class="sidebar_list_target">ワイパーブレード</a>
  266.                 <div class="sidebar_box">
  267.                     <div class="sidebar_box_navi">
  268.                         <a href="" class="sidebar_box_link">ワイパーブレード</a>
  269.                         <ul class="sidebar_box_child">
  270.                             <li class="sidebar_box_child_item">
  271.                                 <a href="" class="sidebar_box_link">トーナメントワイパー</a>
  272.                             </li>
  273.                             <li class="sidebar_box_child_item">
  274.                                 <a href="" class="sidebar_box_link">リヤ専用ワイパーブレード</a>
  275.                             </li>
  276.                             <li class="sidebar_box_child_item">
  277.                                 <a href="" class="sidebar_box_link">デザインワイパーブレード</a>
  278.                             </li>
  279.                             <li class="sidebar_box_child_item">
  280.                                 <a href="" class="sidebar_box_link">撥水フラットワイパーブレード</a>
  281.                             </li>
  282.                             <li class="sidebar_box_child_item">
  283.                                 <a href="" class="sidebar_box_link">スノーワイパーブレード</a>
  284.                             </li>
  285.                         </ul>
  286.                     </div>
  287.                     <picture class="sidebar_box_image">
  288.                         <img src="{{ asset('assets/img/common/category/sample01.jpg', 'user_data') }}" alt="">
  289.                     </picture>
  290.                 </div>
  291.             </li>
  292.             <li class="sidebar_list_item">
  293.                 <a href="" class="sidebar_list_target">ワイパー替えゴム</a>
  294.                 <div class="sidebar_box">
  295.                     <div class="sidebar_box_navi">
  296.                         <a href="" class="sidebar_box_link">ワイパー替えゴム</a>
  297.                         <ul class="sidebar_box_child">
  298.                             <li class="sidebar_box_child_item">
  299.                                 <a href="" class="sidebar_box_link">TW替えゴム</a>
  300.                             </li>
  301.                             <li class="sidebar_box_child_item">
  302.                                 <a href="" class="sidebar_box_link">TN替えゴム</a>
  303.                             </li>
  304.                             <li class="sidebar_box_child_item">
  305.                                 <a href="" class="sidebar_box_link">デザイン替えゴム</a>
  306.                             </li>
  307.                             <li class="sidebar_box_child_item">
  308.                                 <a href="" class="sidebar_box_link">AS替えゴム</a>
  309.                             </li>
  310.                             <li class="sidebar_box_child_item">
  311.                                 <a href="" class="sidebar_box_link">MF替えゴム</a>
  312.                             </li>
  313.                             <li class="sidebar_box_child_item">
  314.                                 <a href="" class="sidebar_box_link">MB替えゴム</a>
  315.                             </li>
  316.                         </ul>
  317.                     </div>
  318.                     <picture class="sidebar_box_image">
  319.                         <img src="{{ asset('assets/img/common/category/sample02.jpg', 'user_data') }}" alt="">
  320.                     </picture>
  321.                 </div>
  322.             </li>
  323.             <li class="sidebar_list_item">
  324.                 <a href="" class="sidebar_list_target">エアコンケミカル</a>
  325.                 <div class="sidebar_box">
  326.                     <div class="sidebar_box_navi">
  327.                         <a href="" class="sidebar_box_link">エアコンケミカル</a>
  328.                         <ul class="sidebar_box_child">
  329.                             <li class="sidebar_box_child_item">
  330.                                 <a href="" class="sidebar_box_link">ガス回収機</a>
  331.                             </li>
  332.                             <li class="sidebar_box_child_item">
  333.                                 <a href="" class="sidebar_box_link">エアコン洗浄</a>
  334.                             </li>
  335.                             <li class="sidebar_box_child_item">
  336.                                 <a href="" class="sidebar_box_link">車内洗浄</a>
  337.                             </li>
  338.                             <li class="sidebar_box_child_item">
  339.                                 <a href="" class="sidebar_box_link">その他</a>
  340.                             </li>
  341.                         </ul>
  342.                     </div>
  343.                     <picture class="sidebar_box_image">
  344.                         <img src="{{ asset('assets/img/common/category/sample03.jpg', 'user_data') }}" alt="">
  345.                     </picture>
  346.                 </div>
  347.             </li>
  348.             <li class="sidebar_list_item">
  349.                 <a href="" class="sidebar_list_target">下廻りケミカル</a>
  350.                 <div class="sidebar_box">
  351.                     <div class="sidebar_box_navi">
  352.                         <a href="" class="sidebar_box_link">下廻りケミカル</a>
  353.                         <ul class="sidebar_box_child">
  354.                             <li class="sidebar_box_child_item">
  355.                                 <a href="" class="sidebar_box_link">下廻り防錆剤</a>
  356.                             </li>
  357.                         </ul>
  358.                     </div>
  359.                     <picture class="sidebar_box_image">
  360.                         <img src="{{ asset('assets/img/common/category/sample04.jpg', 'user_data') }}" alt="">
  361.                     </picture>
  362.                 </div>
  363.             </li>
  364.             <li class="sidebar_list_item">
  365.                 <a href="" class="sidebar_list_target">クーラントケミカル</a>
  366.                 <div class="sidebar_box">
  367.                     <div class="sidebar_box_navi">
  368.                         <a href="" class="sidebar_box_link">クーラントケミカル</a>
  369.                     </div>
  370.                     <picture class="sidebar_box_image">
  371.                         <img src="{{ asset('assets/img/common/category/sample05.jpg', 'user_data') }}" alt="">
  372.                     </picture>
  373.                 </div>
  374.             </li>
  375.             <li class="sidebar_list_item">
  376.                 <a href="" class="sidebar_list_target">洗車ケミカル</a>
  377.                 <div class="sidebar_box">
  378.                     <div class="sidebar_box_navi">
  379.                         <a href="" class="sidebar_box_link">洗車ケミカル</a>
  380.                         <ul class="sidebar_box_child">
  381.                             <li class="sidebar_box_child_item">
  382.                                 <a href="" class="sidebar_box_link">虫取り除去剤</a>
  383.                             </li>
  384.                         </ul>
  385.                     </div>
  386.                     <picture class="sidebar_box_image">
  387.                         <img src="{{ asset('assets/img/common/category/sample06.jpg', 'user_data') }}" alt="">
  388.                     </picture>
  389.                 </div>
  390.             </li>
  391.             <li class="sidebar_list_item">
  392.                 <a href="" class="sidebar_list_target">シートクリーナー</a>
  393.                 <div class="sidebar_box">
  394.                     <div class="sidebar_box_navi">
  395.                         <a href="" class="sidebar_box_link">シートクリーナー</a>
  396.                     </div>
  397.                     <picture class="sidebar_box_image">
  398.                         <img src="{{ asset('assets/img/common/category/sample01.jpg', 'user_data') }}" alt="">
  399.                     </picture>
  400.                 </div>
  401.             </li>
  402.             <li class="sidebar_list_item">
  403.                 <a href="" class="sidebar_list_target">フィルター</a>
  404.                 <div class="sidebar_box">
  405.                     <div class="sidebar_box_navi">
  406.                         <a href="" class="sidebar_box_link">フィルター</a>
  407.                         <ul class="sidebar_box_child">
  408.                             <li class="sidebar_box_child_item">
  409.                                 <a href="" class="sidebar_box_link">エアコンフィルター</a>
  410.                             </li>
  411.                         </ul>
  412.                     </div>
  413.                     <picture class="sidebar_box_image">
  414.                         <img src="{{ asset('assets/img/common/category/sample02.jpg', 'user_data') }}" alt="">
  415.                     </picture>
  416.                 </div>
  417.             </li>
  418.             <li class="sidebar_list_item">
  419.                 <a href="" class="sidebar_list_target">その他</a>
  420.                 <div class="sidebar_box">
  421.                     <div class="sidebar_box_navi">
  422.                         <a href="" class="sidebar_box_link">その他</a>
  423.                     </div>
  424.                     <picture class="sidebar_box_image">
  425.                         <img src="{{ asset('assets/img/common/category/sample03.jpg', 'user_data') }}" alt="">
  426.                     </picture>
  427.                 </div>
  428.             </li>
  429.         </ul>
  430.     </div>
  431. </div>