{% if parametre is not defined %}
{% set parametre = ParametreSite() %}
{% endif %}
{% set grid1 = bloc.grid != null? (12 - bloc.grid):'7' %}
{% set grid2 = bloc.grid != null? bloc.grid:'5' %}
<div id="bloc-{{bloc.id}}" class="text-widget text-widget-20">
<section class="sec-bloc2-art espace-p-top espace-p-bottom" {% if bloc.bg_color %}style="background-color:{{bloc.bg_color}};"{% endif %}>
<div class="container-fluid wrapper">
<div class="row align-items-center">
<div class="content-bloc col-sm-12 col-md-{{grid1}} {{bloc.position == 'right'?'order-md-2':'order-md-1'}}">
{% if parametre.actiftitre == true %}
<div class="titre_site">{{parametre.titre}}</div>
{% endif %}
{% if bloc.title != "" %}
<h2 class="sub-title">{{bloc.title|raw}}</h2>
{% endif %}
{% if bloc.content is not empty %}
{{bloc.content|raw}}
{% endif %}
</div>
{% if bloc.image is defined and bloc.image != "" %}
<div class="image-bloc col-sm-12 col-md-{{grid2}} {{bloc.position == 'right'?'order-md-1':'order-md-2'}} text-center pr-md-3 pl-md-0 px-sm-5 px-5">
<img src="{{asset_image(bloc.image,'medium',['files1024','files800','files480'])}}" alt="{{bloc.altimage}}" class="img-fluid" loading="lazy">
</div>
{% elseif bloc.url_video is defined and bloc.url_video != "" %}
<div class="col-sm-12 col-md-{{grid2}} {{bloc.position == 'right'?'order-md-1':'order-md-2'}} text-center pr-md-3 pl-md-0 px-sm-5 px-5">
<div class="video">
{% if bloc.url_video %}
{% set id_video_externe = bloc.url_video|extract_v %}
{% else %}
{% set id_video_externe = bloc.url_video|replace({'https://youtu.be/': ''})%}
{% endif %}
<a class="video-thumbnail m-0" href="{{bloc.url_video}}" data-fancybox="video">
<img src="https://img.youtube.com/vi/{{id_video_externe}}/maxresdefault.jpg" class="img-fluid w-100" alt="" />
</a>
</div>
</div>
{% endif %}
</div>
</div>
</section>
</div>