{% extends 'front_v4/base.html.twig' %}
{% block meta_title %}{{ blogPost.metaTitle }}{% endblock meta_title %}
{% block meta_description %}{{ blogPost.metaDescription }}{% endblock meta_description %}
{% block meta_custom %}
{% include '/front_v4/mca/blog/_balise_schema_org.html.twig' with {'post': blogPost} %}
{% endblock meta_custom %}
{# Add custom text (CTA + form) depend on theme of blogCategory #}
{% set blogCategoryId = blogPost.blogCategory.id %}
{% set isBlogCategoryThemeAudio = false %}
{% if blogCategoryId == 3 or blogCategoryId == 4 or blogCategoryId == 5 %}
{% set isBlogCategoryThemeAudio = true %}
{% endif %}
{% block content %}
<main id="content" role="main">
<!-- Header Img BG -->
<div class="bg-img-center gradient-y-overlay-sm-gray-900"
style="background-image: url({% if blogPost.filename %} {{ vich_uploader_asset(blogPost, 'imageFile') | imagine_filter('blog_post_main') }} {% endif %});">
<div class="container content-space-2 content-space-lg-3">
<div class="w-lg-30 text-center mx-lg-auto">
<div class="mb-4">
<h1 class="h4 display-4 text-white mb-3">{{ blogPost.title }}</h1>
</div>
</div>
</div>
</div>
<!-- End Header Img BG -->
<!-- Content Article -->
<div class="row justify-content-end">
<div class="col-lg-9 my-2 my-md-7 mb-md-0">
<!-- Article Description -->
<div class="container-fluid content-space-t-1 content-space-b-lg-2">
<div class="w-lg-85 mx-lg-auto">
<div class="row align-items-sm-center mb-5">
<div class="col-sm-7 mb-4 mb-sm-0">
<!-- Media -->
<div class="d-flex align-items-center">
<div class="flex-shrink-0">
<img class="avatar avatar-circle"
src="{% if blogPost.blogAuthor.filename %} {{ vich_uploader_asset(blogPost.blogAuthor, 'imageFile') | imagine_filter('author_image_small') }} {% endif %}"
alt="{{ blogPost.blogAuthor.firstname }}">
</div>
<div class="flex-grow-1 ms-3">
<h5 class="mb-0">
<a class="text-dark"
href="{{ path('blog_author_show', {'id': blogPost.blogAuthor.id }) }}">{{ blogPost.blogAuthor.firstname }}</a>
</h5>
<span class="d-block small">{{ blogPost.createdAt|format_date('medium') }}</span>
</div>
</div>
<!-- End Media -->
</div>
<!-- End Col -->
</div>
<!-- End Row -->
</div>
<!-- Body Content Main -->
<div class="w-lg-85 mx-lg-auto">
{{ blogPost.body|raw() }}
</div>
<!-- End Body Content Main -->
<!-- CTA -->
<div class="container py-5 mb-3">
<div class="w-lg-75 mx-lg-auto">
<div class="card card-sm overflow-hidden">
<!-- Card -->
<div class="card-body">
<div class="row justify-content-md-start align-items-md-center text-center text-md-start">
<div class="col-md offset-md-3 mb-3 mb-md-0">
<h4 class="card-title">
{% if isBlogCategoryThemeAudio %}
Testez vos futurs appareils auditifs
{% else %}
Réalisez votre bilan auditif<sup class="text-sm"> (1)</sup> gratuit
{% endif %}
</h4>
</div>
<div class="col-md-auto">
<a class="btn btn-warning btn-transition" href="#bilan-test-gratuit">Réservez un RDV</a>
</div>
</div>
<!-- SVG Shape -->
<figure class="w-25 d-none d-md-block position-absolute top-0 start-0 mt-n2">
<svg viewBox="0 0 451 902" fill="none" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.125" d="M0 82C203.8 82 369 247.2 369 451C369 654.8 203.8 820 0 820" stroke="url(#paint2_linear)" stroke-width="164" stroke-miterlimit="10"/>
<defs>
<linearGradient id="paint2_linear" x1="323.205" y1="785.242" x2="-97.6164" y2="56.3589" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="white" stop-opacity="0"/>
<stop offset="1" stop-color="#377dff"/>
</linearGradient>
</defs>
</svg>
</figure>
<!-- End SVG Shape -->
</div>
<!-- End Card -->
</div>
</div>
</div>
<!-- End CTA -->
<!-- Body Content Second -->
<div class="w-lg-85 mx-lg-auto">
{{ blogPost.bodySecond|raw() }}
</div>
<!-- End Body Content Second -->
<div class="w-lg-85 mx-lg-auto">
<!-- Card -->
<div class="card bg-dark text-center my-4"
style="background-image: url({{ asset('build/front_v4/svg/components/wave-pattern-light.svg') }});">
<div class="card-body">
<h4 class="text-white">Vous avez aimé cette article ?</h4>
<p class="text-white mb-4">Suivez-nous sur <a class="link"
href="https://www.facebook.com/MonCentreAuditif/">Facebook</a>
et <a class="link"
href="https://www.linkedin.com/company/auditif/">Linkedin</a> pour rester
informé.
</p>
</div>
</div>
<!-- End Card -->
</div>
<!-- Sticky Block End Point -->
<div id="stickyBlockEndPoint"></div>
</div>
<!-- End Article Description -->
</div>
<div class="col-lg-3 position-relative zi-2 my-3 my-md-7 mb-md-0 px-4">
<!-- Sticky Block Start Point -->
<div id="stickyBlockStartPoint"></div>
<div class="js-sticky-block"
data-hs-sticky-block-options='{
"parentSelector": "#stickyBlockStartPoint",
"targetSelector": "#header",
"breakpoint": "md",
"startPoint": "#stickyBlockStartPoint",
"endPoint": "#stickyBlockEndPoint",
"stickyOffsetTop": 80
}'>
<!-- CTA Card -->
<div class="card my-3 my-lg-5">
<div class="p-1">
<a href="{{ app.request.schemeAndHttpHost ~ '/' ~ blogPost.ctaLinkPath }}">
<!-- Fancybox -->
<div class="bg-img-start text-center rounded-2 py-3 py-md-5 px-5 gradient-y-lg-white"
style="background-image: url({{ asset('build/front_v4/svg/components/card-11.svg') }});">
<span class="d-flex justify-content-center align-items-center"></span>
<span class="h3 text-primary">
{% if isBlogCategoryThemeAudio %}
Testez vos futurs appareils auditifs
{% else %}
Réalisez votre bilan auditif<sup class="text-sm"> (1)</sup>
{% endif %}
</span>
<p class="h2 text-primary fw-bold py-2">
100% gratuit
</p>
</div>
<!-- End Fancybox -->
</a>
</div>
<!-- Card Body -->
<div class="card-body">
<div class="d-grid mb-2">
<a class="btn btn-warning btn-transition" href="#bilan-test-gratuit">Réservez un RDV</a>
</div>
<div class="text-center">
<p class="card-text small">Un test sans engagement et non médical.</p>
</div>
</div>
<!-- End CTA Card Body -->
</div>
<!-- End Card -->
{% if relatedCategoryPosts is defined and relatedCategoryPosts is not empty %}
<div class="d-none d-lg-block my-5 my-lg-5">
<div class="mb-3">
<h3>Articles similaires :</h3>
</div>
<div class="d-grid gap-2">
{% for post in relatedCategoryPosts %}
<!-- Card -->
<a class="d-block" href="{{ path('blog_post_show', {'slug': post.slug}) }}">
<div class="d-flex align-items-center">
<div class="flex-shrink-0">
<div class="avatar avatar-lg">
<img class="avatar-img"
src="{% if post.filename %} {{ vich_uploader_asset(post, 'imageFile') | imagine_filter('blog_post_small') }} {% endif %}"
alt="{{ post.title }}">
</div>
</div>
<div class="flex-grow-1 ms-3">
<h5 class="text-inherit mb-0">{{ post.title }}</h5>
</div>
</div>
</a>
<!-- End Card -->
{% endfor %}
</div>
</div>
{% endif %}
</div>
<!-- End Sticky Block -->
</div>
</div>
<!-- Header Content Article -->
<div id="bilan-test-gratuit" class="bg-dark" style="background-image: url({{ asset('build/front_v4/svg/components/wave-pattern-light.svg') }});">
<div class="w-85 w-lg-65 w-xl-50 mx-auto py-5 py-lg-10">
<div class="card">
<div class="card-body">
{% if isBlogCategoryThemeAudio %}
{% set introText = '
<div class="mb-4">
<p class="h2 text-primary fw-semibold text-center">Testez gratuitement vos futurs appareils auditifs</h1>
<p class="lead text-center" style="font-size: 1.125rem;">
Sans engagement, 100% gratuit. Découvrez le confort d’une meilleure audition.
<br>
<strong>Complétez le formulaire</strong> ci-dessous pour réserver votre essai.
</p>
</div>
' %}
{% else %}
{# respect SEO hn title and add text-center #}
{% set introText = '
<div class="mb-4">
<p class="h2 text-primary text-center fw-semibold text-center">Demandez votre bilan auditif<sup>(1)</sup> gratuit</h1>
<p class="lead text-center" style="font-size: 1.125rem;">
Un test non médical, 100% gratuit, pour évaluer votre audition près de chez vous.
<br>
<strong>Remplissez le formulaire</strong> ci-dessous pour en bénéficier.
</p>
</div>
' %}
{% endif %}
{% include 'front_v4/mca/landing_page/form/_wrapper_form_lp_prospect.html.twig' %}
</div>
</div>
</div>
</div>
<!-- Card Grid -->
<div class="container">
<div class="border-top content-space-2 mx-lg-auto">
<!-- Heading -->
<div class="mb-3 mb-sm-5">
<h2>Notre sélection d'articles</h2>
</div>
<!-- End Heading -->
<div class="row">
{% for post in pilarPosts %}
{% if loop.index is odd %}
<div class="col-sm-6 col-lg-4 mb-4">
<a href="{{ path('blog_post_show', {'slug': post.slug}) }}">
<!-- Card -->
<div class="card h-100">
<div class="shape-container">
<img class="card-img-top"
src="{% if blogPost.filename %}{{ vich_uploader_asset(post, 'imageFile') | imagine_filter('blog_post_medium') }}{% endif %}"
alt="{{ post.title }}">
<!-- Shape -->
<div class="shape shape-bottom zi-1" style="margin-bottom: -.25rem">
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
viewBox="0 0 1920 100.1">
<path fill="#fff"
d="M0,0c0,0,934.4,93.4,1920,0v100.1H0L0,0z"></path>
</svg>
</div>
<!-- End Shape -->
</div>
<!-- Card Body -->
<div class="card-body p-3">
<h4 class="card-title text-dark">{{ post.title }}</h4>
<p class="card-text">{{ post.body|striptags|truncate(80, true)|raw|nl2br }}</p>
</div>
<!-- End Card Body -->
<!-- Card Footer -->
<div class="card-footer">
<div class="d-flex align-items-center justify-content-between">
<span class="avatar avatar-circle">
<img class="avatar-img"
src="{% if post.blogAuthor.filename %} {{ vich_uploader_asset(post.blogAuthor, 'imageFile') | imagine_filter('author_image_small') }} {% endif %}"
alt="{{ post.blogAuthor.firstname }}">
</span>
<div class="flex-grow-1">
<div class="d-flex justify-content-end">
<p class="card-text">{{ post.createdAt|format_date('medium') }}</p>
</div>
</div>
</div>
</div>
<!-- End Card Footer -->
</div>
<!-- End Card -->
</a>
</div>
<!-- End Col -->
{% else %}
<div class="col-sm-6 col-lg-4 mb-4">
<a href="{{ path('blog_post_show', {'slug': post.slug}) }}">
<!-- Card -->
<div class="card bg-dark h-100"
style="background-image: url({{ asset('build/front_v4/svg/components/wave-pattern-light.svg') }});">
<!-- Card Body -->
<div class="card-body p-3 py-5">
<div class="mb-5">
<span class="badge bg-primary">Sélection du mois</span>
</div>
<h3 class="card-title text-white">{{ post.title }}</h3>
<p class="text-white-70">{{ post.body|striptags|truncate(180, true)|raw|nl2br }}</p>
</div>
<!-- End Card Body -->
<!-- Card Footer -->
<div class="card-footer">
<div class="d-flex align-items-center">
<div class="flex-shrink-0">
<div class="avatar avatar-circle">
<img class="avatar-img"
src="{% if post.blogAuthor.filename %} {{ vich_uploader_asset(post.blogAuthor, 'imageFile') | imagine_filter('author_image_small') }} {% endif %}"
alt="{{ post.blogAuthor.firstname }}">
</div>
</div>
<div class="flex-grow-1">
<div class="d-flex justify-content-end">
<p class="card-text text-white-70">{{ post.createdAt|format_date('medium') }}</p>
</div>
</div>
</div>
</div>
<!-- End Card Footer -->
</div>
<!-- End Card -->
</a>
</div>
<!-- End Col -->
{% endif %}
{% endfor %}
</div>
<!-- End Row -->
</div>
<!-- End Card Grid -->
</div>
<!-- End Card Grid -->
</main>
<!-- ========== END MAIN CONTENT ========== -->
{% endblock content %}
{% block javascripts %}
<script
src="https://code.jquery.com/jquery-3.7.1.min.js"
integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo="
crossorigin="anonymous"></script>
{{ encore_entry_script_tags('format_form_prospect') }}
{{ encore_entry_script_tags('blog_single') }}
{% endblock javascripts %}