custom/plugins/SwagCmsExtensions/src/Resources/views/storefront/page/content/detail.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/content/detail.html.twig' %}
  2. {% block page_content_sections_inner %}
  3.     {{ parent() }}
  4.     {% set anchoredSections = [] %}
  5.     {% for section in page.cmsPage.sections %}
  6.         {% if section.extensions.swagCmsExtensionsScrollNavigation.active %}
  7.             {% set anchoredSections = anchoredSections|merge([section]) %}
  8.         {% endif %}
  9.     {% endfor %}
  10.     {% block swag_cms_extensions_scroll_navigation_sidebar %}
  11.         {% if anchoredSections|length > 0 %}
  12.             {% set pageSettingsExtension = constant('Swag\\CmsExtensions\\Extension\\Feature\\ScrollNavigation\\CmsPageEntityExtension::SCROLL_NAVIGATION_PAGE_SETTINGS_PROPERTY_NAME') %}
  13.             {% set options = { pageSettings: page.cmsPage.extensions[pageSettingsExtension] } %}
  14.             <div class="scroll-navigation-sidebar"
  15.                  data-swag-cms-extensions-scroll-navigation="true"
  16.                  data-swag-cms-extensions-scroll-navigation-options="{{ options|json_encode }}"
  17.                  data-swag-cms-extensions-scroll-navigation-toggle-menu="true">
  18.                 {% block swag_cms_extensions_scroll_navigation_sidebar_mobile_menu %}
  19.                     <div class="scroll-navigation-sidebar-mobile-menu">
  20.                         {% apply spaceless %}
  21.                             {% block swag_cms_extensions_scroll_navigation_sidebar_mobile_menu_button_list %}
  22.                                 <div class="scroll-navigation-sidebar-mobile-button">
  23.                                     <button id="scroll-navigation-mobile-button-list"
  24.                                             class="scroll-navigation-sidebar-mobile-button-icon scroll-navigation-menu-toggle">
  25.                                         {% block swag_cms_extensions_scroll_navigation_sidebar_mobile_menu_button_list_content %}
  26.                                             {% sw_icon 'stack' style { 'size': 'xl' } %}
  27.                                         {% endblock %}
  28.                                     </button>
  29.                                 </div>
  30.                             {% endblock %}
  31.                             {% block swag_cms_extensions_scroll_navigation_sidebar_mobile_menu_button_up %}
  32.                                 <div class="scroll-navigation-sidebar-mobile-button">
  33.                                     <button id="scroll-navigation-mobile-button-up"
  34.                                             class="scroll-navigation-sidebar-mobile-button-icon">
  35.                                         {% block swag_cms_extensions_scroll_navigation_sidebar_mobile_menu_button_up_content %}
  36.                                             {% sw_icon 'arrow-head-up' style { 'size': 'xl' } %}
  37.                                         {% endblock %}
  38.                                     </button>
  39.                                 </div>
  40.                             {% endblock %}
  41.                             {% block swag_cms_extensions_scroll_navigation_sidebar_mobile_menu_button_down %}
  42.                                 <div class="scroll-navigation-sidebar-mobile-button">
  43.                                     <button id="scroll-navigation-mobile-button-down"
  44.                                             class="scroll-navigation-sidebar-mobile-button-icon">
  45.                                         {% block swag_cms_extensions_scroll_navigation_sidebar_mobile_menu_button_down_content %}
  46.                                             {% sw_icon 'arrow-head-down' style { 'size': 'xl' } %}
  47.                                         {% endblock %}
  48.                                     </button>
  49.                                 </div>
  50.                             {% endblock %}
  51.                         {% endapply %}
  52.                     </div>
  53.                 {% endblock %}
  54.                 {% block swag_cms_extensions_scroll_navigation_sidebar_toggle_close %}
  55.                     <div class="scroll-navigation-sidebar-close scroll-navigation-menu-toggle">
  56.                         {% sw_icon 'x' style { 'size': 'xl' }  %}
  57.                     </div>
  58.                 {% endblock %}
  59.                 {% block swag_cms_extensions_scroll_navigation_sidebar_list %}
  60.                     <div class="scroll-navigation-sidebar-list">
  61.                         {% for section in anchoredSections %}
  62.                             {% set scrollNavigation = section.extensions.swagCmsExtensionsScrollNavigation %}
  63.                             {% set anchor = scrollNavigation.translated.displayName %}
  64.                             {% block swag_cms_extensions_scroll_navigation_sidebar_list_entry %}
  65.                                 <a class="scroll-navigation-sidebar-entry"
  66.                                    href="#nav-{{ anchor|lower|slugify|replace({'.': ''}) }}">
  67.                                     {% block swag_cms_extensions_scroll_navigation_sidebar_list_entry_line %}
  68.                                         <div class="scroll-navigation-sidebar-entry-line"></div>
  69.                                     {% endblock %}
  70.                                     {% block swag_cms_extensions_scroll_navigation_sidebar_list_entry_bullet %}
  71.                                         <span class="scroll-navigation-sidebar-entry-bullet"></span>
  72.                                     {% endblock %}
  73.                                     {% block swag_cms_extensions_scroll_navigation_sidebar_list_entry_label %}
  74.                                         <span class="scroll-navigation-sidebar-entry-label">
  75.                                             {% block swag_cms_extensions_scroll_navigation_sidebar_list_entry_label_content %}
  76.                                                 {{ anchor }}
  77.                                             {% endblock %}
  78.                                         </span>
  79.                                     {% endblock %}
  80.                                 </a>
  81.                             {% endblock %}
  82.                         {% endfor %}
  83.                     </div>
  84.                 {% endblock %}
  85.             </div>
  86.         {% endif %}
  87.     {% endblock %}
  88. {% endblock %}
  89. {% block page_content_section %}
  90.     {% set scrollNavigation = section.extensions.swagCmsExtensionsScrollNavigation %}
  91.     {% set anchor = scrollNavigation.translated.displayName|lower|slugify|replace({'.': ''}) %}
  92.     {% if scrollNavigation.active %}
  93.         <div class="swag-cms-extensions-scroll-navigation-wrapper">
  94.             <div class="scroll-navigation-anchor" id="nav-{{ anchor }}"></div>
  95.             {{ parent() }}
  96.         </div>
  97.     {% else %}
  98.         {{ parent() }}
  99.     {% endif %}
  100. {% endblock %}