templates/Frontend/Render/_menu_pages.html.twig line 1

Open in your IDE?
  1. <div class="menu_pages">
  2.   <div class="container">
  3.     {% set pages = Categorypage_list(page_selected.categorie.slug) %}
  4.     <ul>
  5.       {% for page in pages %}
  6.         <li {% if page.slug == page_selected.slug %}class="selected"{% endif %}>
  7.           <a href="{{ path('page_single',{'catslug':page_selected.categorie.slug,'slug':page.slug}) }}">{{page}}</a>
  8.         </li>
  9.       {% endfor %}
  10.     </ul>
  11.     <select id="select_menu_pages">
  12.       {% for page in pages %}
  13.         <option value="{{ path('page_single',{'catslug':page_selected.categorie.slug,'slug':page.slug}) }}" {% if page.slug == page_selected.slug %}selected{% endif %}>
  14.           {{page}}
  15.         </option>
  16.       {% endfor %}
  17.     </select>
  18.   </div>
  19. </div>
  20.     
  21. <script type="text/javascript">
  22.     $('#select_menu_pages').on('change',function(){
  23.         window.location.href = $(this).val();
  24.     });
  25. </script>