templates/frontend/market/index.html.twig line 1
{% extends 'master.html.twig' %}{% block title %}Market{% endblock %}{% block stylesheets %}{{ parent() }}<link rel="stylesheet" href="{{ asset('assets/css/market.css') }}">{% endblock %}{% block body %}<div class="" style="padding-top: 80px;">{% include "_partials/market/hero-section.html.twig" with {} %}<section><div class="container"><div class="shop-clear-filter mb-4">{% include "frontend/market/_partials/scroll-category.html.twig" with {'categories': categories} %}</div><div class="row"><div class="col-lg-4 col-xl-3">{% include "frontend/market/_partials/category.html.twig" with {'categories': categories} %}</div><div class="col-lg-8 col-xl-9">{% if products | length > 0 %}<div class="row">{% include "frontend/market/_partials/products.html.twig" with {'products': products} %}</div><div class="row"><div class="col-md-4 offset-md-4" style="display: flex; justify-content: center;">{{ knp_pagination_render(products, '_partials/widgets/pagination.html.twig') }}</div></div>{% else %}<div class="row"><h1 class="text-center">Pas de produits disponible</h1></div>{% endif %}</div></div></div></section></div>{% endblock %}{% block javascripts %}{{ parent() }}<script>var formId = document.getElementById("searchFormInput");formId.addEventListener("submit", function(event) {event.preventDefault(); // EmpĂȘche l'envoi du formulaire par dĂ©fautvar title = document.querySelector('input[name="title"]').value;var city = document.querySelector('input[name="city"]').value;console.log(title, city);if (title !== "" || city !== "") {// Construction de la nouvelle URLvar newUrl = "{{ path('app_recherche') |escape('js') }}?title=" + encodeURIComponent(title) + "&city=" + encodeURIComponent(city);// Redirection vers la nouvelle URLwindow.location.replace(newUrl);// window.location.href = newUrl;}});</script>{% endblock %}