src/PentagastBundle/Resources/views/storefront/layout/breadcrumb.html.twig line 1

Open in your IDE?
  1. {% sw_extends "@Storefront/storefront/layout/breadcrumb.html.twig" %}
  2. {% block layout_breadcrumb_inner %}
  3.     {{ parent() }}
  4.     
  5.     {% set currentSalesChannelId = context.salesChannel.id %}
  6.     {% set showNextPrevBar = context.salesChannel.customFields['val_pentagast_bundle_prev_next_navigation_enabled'] %}
  7.     
  8.     {% if app.request.get('_route') != 'frontend.home.page' and showNextPrevBar %}
  9.         <style>
  10.             .is-ctl-search .custom-prev-next-bar,
  11.             .is-act-search .custom-prev-next-bar {
  12.                 float: right;
  13.             }
  14.             
  15.             .custom-prev-next-bar {
  16.                 margin-left: auto;
  17.                 display: flex;
  18.                 align-items: center;
  19.                 gap: .5rem;
  20.                 flex: 0 0 auto;
  21.                 padding-top: 10px;
  22.                 padding-bottom: 10px;
  23.             }
  24.             .custom-prev-next-bar .custom-prev-next-btn {
  25.                 background: #e8e8e8;
  26.                 width: 30px;
  27.                 height: 30px;
  28.                 border-radius: 100%;
  29.                 transition: all .2s ease;
  30.             }
  31.             .custom-prev-next-btn.is-disabled {
  32.                 pointer-events: none;
  33.                 opacity: .45;
  34.                 cursor: default;
  35.             }
  36.             .custom-prev-next-bar .custom-prev-next-btn:hover { background: var(--primary); }
  37.             .custom-prev-next-btn:hover .icon { color: #fff; }
  38.             .custom-prev-next-bar .custom-prev-next-btn svg {
  39.                 margin: 0 auto;
  40.                 height: auto;
  41.                 top: auto;
  42.                 width: 18px;
  43.             }
  44.         </style>
  45.         <div class="custom-prev-next-bar" data-navbar>
  46.             <a href="#" class="custom-prev-btn custom-prev-next-btn" data-action="back" title="Zurück" aria-disabled="true" tabindex="-1">
  47.                 <span class="icon icon-arrow-medium-left icon-fluid">
  48.                     <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
  49.                         <defs>
  50.                             <path id="icons-solid-arrow-medium-left" d="M4.7071 5.2929c-.3905-.3905-1.0237-.3905-1.4142 0-.3905.3905-.3905 1.0237 0 1.4142l4 4c.3905.3905 1.0237.3905 1.4142 0l4-4c.3905-.3905.3905-1.0237 0-1.4142-.3905-.3905-1.0237-.3905-1.4142 0L8 8.5858l-3.2929-3.293z"></path>
  51.                         </defs>
  52.                         <use transform="matrix(0 -1 -1 0 16 16)" xlink:href="#icons-solid-arrow-medium-left" fill="#758CA3" fill-rule="evenodd"></use>
  53.                     </svg>
  54.                 </span>
  55.             </a>
  56.             <a href="#" class="custom-next-btn custom-prev-next-btn" data-action="forward" title="Vor" aria-disabled="true" tabindex="-1">
  57.                 <span class="icon icon-arrow-medium-right icon-fluid">
  58.                     <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
  59.                         <defs>
  60.                             <path id="icons-solid-arrow-medium-right" d="M4.7071 5.2929c-.3905-.3905-1.0237-.3905-1.4142 0-.3905.3905-.3905 1.0237 0 1.4142l4 4c.3905.3905 1.0237.3905 1.4142 0l4-4c.3905-.3905.3905-1.0237 0-1.4142-.3905-.3905-1.0237-.3905-1.4142 0L8 8.5858l-3.2929-3.293z"></path>
  61.                         </defs>
  62.                         <use transform="rotate(-90 8 8)" xlink:href="#icons-solid-arrow-medium-right" fill="#758CA3" fill-rule="evenodd"></use>
  63.                     </svg>
  64.                 </span>
  65.             </a>
  66.         </div>
  67.         
  68.         <script>
  69.         (function() {
  70.           function boot() {
  71.             const prev = document.querySelector('.custom-prev-btn');
  72.             const next = document.querySelector('.custom-next-btn');
  73.             if (!prev && !next) return;
  74.             prev?.addEventListener('click', function (e) {
  75.               e.preventDefault();
  76.               history.back();
  77.             });
  78.             next?.addEventListener('click', function (e) {
  79.               e.preventDefault();
  80.               history.forward();
  81.             });
  82.           }
  83.           if (document.readyState === 'loading') {
  84.             document.addEventListener('DOMContentLoaded', boot);
  85.           } else {
  86.             boot();
  87.           }
  88.         })();
  89.         </script>
  90.     {% endif %}
  91. {% endblock %}