templates/search/results.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block canon_url_search %}
  3.     {% if seo_strategy == 'index' %}
  4.         {% set req_attr = app.request.attributes.get('_route_params') %}
  5.             {% set req_attr_con = {
  6.             'type' : req_attr['type'],
  7.             'departement': req_attr['departement'],
  8.             'commerce_type': req_attr['commerce_type'],
  9.             'page': app.request.query.get('page'),
  10.             'ville': app.request.query.get('ville')
  11.         } %}
  12.         {% if req_attr_con.page|default('') == 1 %}
  13.             {% set req_attr_con = req_attr_con|arr_unset('page') %}
  14.             {% endif %}
  15.             <link rel="canonical" href="{{ url(app.request.attributes.get('_route'), req_attr_con) }}" />
  16.         {% else %}
  17.             <meta name="robots" content="noindex">
  18.         {% endif %}
  19.     {% endblock %}
  20.     {% block content %}
  21.         {% set params = app.request.attributes.get('_route_params') %}
  22.         {% set breadcrumbArr = [] %}
  23.         <div class="herolander sm-herolander mb-5">
  24.             <div class="container">
  25.                 <div class="row position-relative z-10">
  26.                     <div class="col-lg-12">
  27.                         <h1 class="spec_title text-white">{{  h1_main }}</h1>
  28.                         <p class="spec_title text-white"><em>{{ number_results }} offres correspondent à vos critères</em></p>
  29.                     </div>
  30.                     <div class="col-lg-12">
  31.                         <nav aria-label="breadcrumb">
  32.                             <ol class="breadcrumb bg-transparent pl-0">
  33.                                 <li class="breadcrumb-item">
  34.                                     <a href="{{ url('homepage') }}" class="text-white">Accueil</a>
  35.                                 </li>
  36.                                 {% if params.type %}
  37.                                     {% set bd_url = url('search_results', {'type': params.type}) %}
  38.                                     {% set bd_text = params.type|search_breadcrumb('type') %}
  39.                                     {% set breadcrumbArr = breadcrumbArr|merge([{'url': bd_url, 'text': bd_text}]) %}
  40.                                     {% if bd_url == app.request.uri %}
  41.                                         <li class="breadcrumb-item active text-white" aria-current="page">
  42.                                             <u>{{  h1_main }}</u>
  43.                                         </li>
  44.                                     {% else %}
  45.                                         <li class="breadcrumb-item">
  46.                                             <a href="{{ bd_url }}" class="text-white">{{ bd_text }}</a>
  47.                                         </li>
  48.                                     {% endif %}
  49.                                 {% endif %}
  50.                                 {% if params.commerce_type %}
  51.                                     {% set bd_url = url('search_results', {'type': params.type, 'commerce_type': params.commerce_type}) %}
  52.                                     {% set bd_text = params.commerce_type|search_breadcrumb('commerce_type') %}
  53.                                     {% set breadcrumbArr = breadcrumbArr|merge([{'url': bd_url, 'text': bd_text}]) %}
  54.                                     {% if bd_url == app.request.uri %}
  55.                                         <li class="breadcrumb-item active text-white" aria-current="page">
  56.                                             <u>{{  h1_main }}</u>
  57.                                         </li>
  58.                                     {% else %}
  59.                                         <li class="breadcrumb-item">
  60.                                             <a href="{{ bd_url }}" class="text-white">{{ bd_text }}</a>
  61.                                         </li>
  62.                                     {% endif %}
  63.                                 {% endif %}
  64.                                 {% if params.departement %}
  65.                                     {% set bd_url = url('search_results',{'type': params.type, 'commerce_type': params.commerce_type, 'departement': params.departement}) %}
  66.                                     {% set bd_text = params.departement|search_breadcrumb('departement') %}
  67.                                     {% set breadcrumbArr = breadcrumbArr|merge([{'url': bd_url, 'text': bd_text}]) %}
  68.                                     {% if bd_url == app.request.uri %}
  69.                                         <li class="breadcrumb-item active text-white" aria-current="page">
  70.                                             <u>{{  h1_main }}</u>
  71.                                         </li>
  72.                                     {% else %}
  73.                                         <li class="breadcrumb-item">
  74.                                             <a href="{{ bd_url }}" class="text-white">{{ bd_text }}</a>
  75.                                         </li>
  76.                                     {% endif %}
  77.                                 {% endif %}
  78.                             </ol>
  79.                         </nav>
  80.                     </div>
  81.                 </div>
  82.             </div>
  83.         </div>
  84.         <script type="application/ld+json">
  85.         {
  86.             "@context": "http://schema.org",
  87.             "@type": "BreadcrumbList",
  88.             "itemListElement":
  89.             [
  90.             {% for keyword in breadcrumbArr %}
  91.                 {% if keyword is iterable %}
  92.                 {
  93.                     "@type": "ListItem",
  94.                     "position": {{ loop.index }},
  95.                     "item":
  96.                     {
  97.                         "@id": "{{ keyword.url }}",
  98.                         "name": "{{ keyword.text }}"
  99.                     }
  100.                 }
  101.                     {% endif %}
  102.                 {% if not loop.last %},{% endif %}
  103.             {% endfor %}
  104.             ]
  105.         }
  106.         </script>
  107.             <section class="search-results">
  108.                 <div class="container">
  109.                     {% if agent_info %}
  110.                         <h3 class="spec_title title-regular">
  111.                             <em>Annonces de</em>
  112.                             <span class="label label-info"> {{ agent_info.raison_sociale|raw }}</span>
  113.                             <img height="45" style="vertical-align:bottom" src="{{ agent_info.logo }}" alt="logo {{ agent_info.raison_sociale }}">
  114.                         </h3>
  115.                     {% endif %}
  116.                     {% block error %}
  117.                         {% if error is defined %}
  118.                             {% include 'default/error.html.twig' %}
  119.                         {% endif %}
  120.                     {% endblock %}
  121.                     {#<div class="search-filter">
  122.                         <div class="row">
  123.                             <div class="col-lg-12 text-center">
  124.                                 <div class="spec_title _title h4">
  125.                                     <b><span class="">{{ number_results }} offres</span> correspondent à vos critères : </b>
  126.                                     <hr>
  127.                                 </div>
  128.                                 <div class="criterias">
  129.                                     {% for keyword in keywords %}
  130.                                         {% if keyword is iterable %}
  131.                                             <p class="bg-success p-2 mx-1 rounded-lg d-inline-block"><a style="color: white" href="{{ keyword.url }}">{{ keyword.text }}</a></p>
  132.                                         {% else %}
  133.                                             <p class="bg-success p-2 mx-1 rounded-lg d-inline-block">{{ keyword }}</p>
  134.                                         {% endif %}
  135.                                     {% endfor %}
  136.                                 </div>
  137.                             </div>
  138.                         </div>
  139.                     </div>#}
  140.                     <div class="row d-flex align-items-center mb-3">
  141.                         <div class="col-lg-9 text-right">
  142.                             {% if pagination is not empty %}
  143.                                 {% include "search/pagination.html.twig" %}
  144.                             {% endif %}
  145.                         </div>
  146.                         <div class="col-lg-3">
  147.                             {% if order_select is not empty %}
  148.                                 {% include "search/order.html.twig" %}
  149.                             {% endif %}
  150.                         </div>
  151.                     </div>
  152.                     <div class="row">
  153.                         <hr>
  154.                         <div class="col-lg-12">
  155.                             <div class="content">
  156.                                 {% for item in items if items is defined %}
  157.                                     {% include "search/item.html.twig" %}
  158.                                 {% endfor %}
  159.                             </div>
  160.                         </div>
  161.                         <div class="col-lg-12 text-center my-3">
  162.                             {% if pagination is not empty %}
  163.                                 {% include "search/pagination.html.twig" %}
  164.                             {% endif %}
  165.                         </div>
  166.                         <div class="row d-flex align-items-center w-100 mb-3">
  167.                             {% if keywords_suggestions %}
  168.                                 <div class="col-lg-12">
  169.                                     <span class="spec_title _title">
  170.                                         <b><span class="">Suggestions : </span></b>
  171.                                     </span>
  172.                                     <div class="criterias w-100">
  173.                                         {% for keyword in keywords_suggestions %}
  174.                                             {% if keyword is iterable %}
  175.                                                 <div class="d-inline-block bg-dark p-2 m-1 text-white rounded-lg"><a class="text-white" href="{{ keyword.url }}">{{ keyword.text }}</a></div>
  176.                                             {% else %}
  177.                                                 <div class="d-inline-block bg-dark p-2 mx-1 rounded-lg">{{ keyword }}</div>
  178.                                             {% endif %}
  179.                                         {% endfor %}
  180.                                     </div>
  181.                                 </div>
  182.                             {% endif %}
  183.                         </div>
  184.                     </div>
  185.                     <small class="_notification _notification-simple text-center">
  186.                         <span class="zmdi zmdi-circle text-danger"></span>&nbsp;
  187.                         Les informations données sur ce site n’ont pas un caractère contractuel. Les caractéristiques des biens à vendre ainsi que leur prix, bien que faisant l’objet d’une attention particulière, sont données sous réserve d’erreurs de saisie ou de vente.
  188.                     </small>
  189.                     <script type="application/ld+json">
  190.                     {"@context":"http://schema.org","@type":"ItemList","name": "{{ page_title }}","numberOfItems":"{{ items|length }}","itemListElement":[
  191.                     {% if items is defined  %}
  192.                     {% for item in items %}
  193.                     {"@type":"Product","category":"{{ item.commerce_type }}","name":"{{ item.title }}","image":"{{ url('homepage') ~ item.picture1 }}",
  194.                     "description":"{{ item.description }}",
  195.                     "url":"{{ url('homepage')  ~ item.url }}",
  196.                     "productid":"{{ item.biz_id }}",
  197.                     "offers":{"@type":"Offer","price":"{{ item.price }}","priceCurrency":"EUR","availableAtOrFrom":{"@type":"Place","address":{"@type":"PostalAddress","addressLocality": "{% if item.found_communes %}{{ item.found_communes }},{% endif %}{{ item.departement }}","addressRegion": "{{ item.region }}"}}}
  198.                 }{% if not loop.last %},{% endif %}
  199.                 {% endfor %}
  200.                 {% endif %}
  201.                 ]}
  202.                 </script>
  203.             </div>
  204.         </section>
  205.     {% endblock %}