app/template/default/Block/header.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. <!-- FONT -->
  9. <link rel="preconnect" href="https://fonts.googleapis.com">
  10. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  11. <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@500;700;900&Heebo:wght@400;700;900&display=swap" rel="stylesheet">
  12. <link href="https://fonts.cdnfonts.com/css/druk-trial" rel="stylesheet">
  13. <!-- CSS -->
  14. <link rel="stylesheet" href="/assets/scss/style.css">
  15. <link rel="stylesheet" href="/assets/scss/sp.css">
  16. <!-- JS ------------------->
  17. <script src="/assets/js/common.js"></script>
  18. <script src="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"></script>
  19. {% set Categories = repository('Eccube\\Entity\\Category').getList() %}
  20. {% macro tree(Category) %}
  21.     {% from _self import tree %}
  22.     <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
  23.         {{ Category.name }}
  24.     </a>
  25.     {% if Category.children|length > 0 %}
  26.         <ul>
  27.             {% for ChildCategory in Category.children %}
  28.                 <li>
  29.                     {{ tree(ChildCategory) }}
  30.                 </li>
  31.             {% endfor %}
  32.         </ul>
  33.     {% endif %}
  34. {% endmacro %}
  35. {# @see https://github.com/bolt/bolt/pull/2388 #}
  36. {% from _self import tree %}
  37. <header id="header">
  38.     <h1>
  39.         <a href="{{ url('homepage') }}"><img src="/assets/images/logo.svg" alt="{{ BaseInfo.shop_name }}"></a>
  40.     </h1>
  41.     <nav>
  42.         <ul>
  43.             <li><a href="{{ url('product_list') }}">ITEM</a></li>
  44.             <!--li>
  45.                 <a href="">CATEGORY</a>
  46.                 <ul>
  47.                     {% for Category in Categories %}
  48.                         <li>{{ tree(Category) }}</li>
  49.                     {% endfor %}
  50.                 </ul>
  51.             </li-->
  52.             <li><a href="{{ url('help_about') }}">ABOUT</a></li>
  53.             <li><a href="{{ url('contact') }}">CONTACT</a></li>
  54.             <li class="member">
  55.                 <div class="mypage">
  56.                     {% if is_granted('ROLE_USER') %}
  57.                         <a href="{{ url('mypage') }}">
  58.                             <img class="icon" src="/assets/images/icon-mypage.svg">
  59.                             <span>{{ 'MYPAGE'|trans }}</span>
  60.                         </a>
  61.                     {% else %}
  62.                         <a href="{{ url('mypage_login') }}">
  63.                             <img class="icon" src="/assets/images/icon-mypage.svg">
  64.                             <span> {{ 'LOGIN'|trans }}</span>
  65.                         </a>
  66.                     {% endif %}
  67.                 </div><!-- /mypage -->
  68.                 <div class="cart">
  69.                     {{ include('Block/cart.twig') }}
  70.                 </div><!-- /cart -->
  71.             </li><!-- /member -->
  72.         </ul>
  73.     </nav>
  74.     <div class="sp member">
  75.         <ul>
  76.             <li class="mypage">
  77.                 {% if is_granted('ROLE_USER') %}
  78.                     <a href="{{ url('mypage') }}"><img class="icon" src="/assets/images/icon-mypage.svg"></a>
  79.                 {% else %}
  80.                     <a href="{{ url('mypage_login') }}"><img class="icon" src="/assets/images/icon-mypage.svg"></a>
  81.                 {% endif %}
  82.             </li><!-- /mypage -->
  83.             <li class="cart">{{ include('Block/cart.twig') }}</li>
  84.         </ul>
  85.         <a class="menu-trigger" onclick="Menu.Swap()">
  86.             <div>
  87.                 <span></span>
  88.                 <span></span>
  89.                 <span></span>
  90.             </div>
  91.         </a>
  92.     </div><!-- /sp -->
  93. </header><!-- /header -->