templates/Recipes/allrecipes.html.twig line 1

Open in your IDE?
  1. {% extends "layout/layout.html.twig" %}
  2. {% block content %}
  3.     {{ render(controller('App\\Controller\\Recipes\\RecipesController::advancefilterBlock')) }}
  4.     <!--Start Breadcrumbs-->
  5.     <div class="breadcrumb-holder">
  6.         <ol class="breadcrumb">
  7.             <li class="breadcrumb-item">
  8.                 <a href="/{{app.request.locale}}">{{"Home"|trans }}</a>
  9.             </li>
  10.             <li class="breadcrumb-item">
  11.                 <a href="/{{app.request.locale}}/recipes">{{"recipes"|trans }}</a>
  12.             </li>
  13.             <li class="breadcrumb-item active" aria-current="page">{{'All Recipes '|trans}}</li>
  14.         </ol>
  15.     </div>
  16.     <!--End Breadcrumbs-->
  17.     <!--Start Featured Recipes Section-->
  18.     <section class="featured-recipes-section inner-featured-recipe all-recipes-load-more-section">
  19.         <div class="container container-sm">
  20.             <h2 class="heading">{{'All Recipes '|trans}}</h2>
  21.             <div class="featured-recipes grid-system all-slides-recipes">
  22.                 <div class="slide-grid new_div" id="object-list">
  23.                     {% for recipe in recipes %}
  24.                         {% if recipe %}
  25.                             {{ include('Recipes/recipe-card-blue.html.twig', { 'recipe': recipe }) }}
  26.                         {% endif %}
  27.                     {% endfor %}
  28.                 </div>
  29.                 <div class="load-more" id="load-more-btn" data-url="{{app.request.pathInfo}}">
  30.                     <span class="btn btn-custom btn-p-outline-blue" id="load-more" >{{'Load more'|trans}}</span>
  31.                 </div>
  32.             </div>
  33.         </div>
  34.     </section>
  35.     {% if (app.request.locale =='ar') %}
  36.         {% set topMenu ="/en/all-recipes" %}
  37.     {% else %}
  38.         {% set topMenu ="/ar/all-recipes" %}
  39.     {% endif %}
  40.     <!--End Featured Recipes Section-->
  41.     <script>
  42.         $(document).ready(function () {
  43.             var page = 2;
  44.             $('#load-more-btn').click(function () {
  45.                 let postUrl = $(this).data('url');
  46.                 $.ajax({
  47.                     url: postUrl  + '?page=' + page,
  48.                     type: 'GET',
  49.                     beforeSend: function () {
  50.                         $('#load-more').addClass('btn-load');
  51.                     },
  52.                     complete: function () {
  53.                         $('#load-more').removeClass('btn-load');
  54.                     },
  55.                     success: function (response) {
  56.                         $('#object-list').append(response.html);
  57.                         if (! response.showLoadMoreButton) {
  58.                             $('#load-more').hide();
  59.                         }
  60.                         page++;
  61.                     }
  62.                 });
  63.             });
  64.         });
  65.         var _TopMenuLink = "{{ topMenu }}";
  66.     </script>
  67. {% endblock %}