ldc-groupe/resources/views/front/partials/text-block.blade.php
2025-08-11 17:21:20 +02:00

135 lines
5.9 KiB
PHP

@php
global $chirkashi;
if(!isset($text_block) && empty($text_block)) {
$text_block = get_field('text_block', $post->ID);
}
$borders = array();
@endphp
@if(empty($text_block['hide_block']))
<div @class([
'textblock fw fw-container',
'textblock_bg' => !empty($text_block['bg']) && $text_block['bg'] == 1,
$custom_class ?? '',
$addclass ?? '',
])>
<div class="textblock__wrapper wrapper">
@if(!empty($text_block['title']) || !empty($text_block['subtitle']['text']))
<h2 class="textblock__title title">
@if(!empty($text_block['title']))
<span class="title-text">{{ $text_block['title'] }}</span>
@endif
@if(!empty($text_block['subtitle']['text']))
<span @class([
'subtitle-text textblock__subtitle subtitle',
'subtitle_paint' => $text_block['subtitle']['cursive']
])>
{{ $text_block['subtitle']['text'] }}
</span>
@endif
</h2>
@endif
@if(!empty($text_block['list']))
@foreach($text_block['list'] as $l)
<div @class([
'textblock__container',
'textblock__container_swap' => $l['swap_position'] == 1,
'textblock__container_row' => $l['in_row'] == 1,
'textblock__container_floated' => $l['floated'] == 1,
'textblock__container_ac' => $l['align_center'] == 1
])>
@if(!empty($l['image']) || !empty($l['video']))
<div class="textblock__image textblock__block">
@if(!empty($l['video']))
<div class="textblock__video video-wrap">
<div class="textblock__video-btn play-button"></div>
{{ $l['video'] }}
</div>
@endif
@if(!empty($l['image']))
@foreach($l['image'] as $i)
<div class="image-border-wrap">
@php
$borders['desktop'] = $l['borders_desktop'];
$borders['mobile'] = $l['borders_mobile'];
@endphp
@include('front.partials.borders', [
'borders' => $borders
])
<img src="{{ $i['url'] }}" alt="{{ !empty($l['title']) ? $l['title'] : $text_block['title'] }}" />
</div>
@endforeach
@endif
@if(!empty($l['image_description']))
<div class="textblock__image-description description">{{ $l['image_description'] }}</div>
@endif
@if(!empty($l['button']['url']) && ($l["button"]["title"] == "Nous Rejoindre" || (!empty($custom_class) ? $custom_class : null) == "notre-politique"))
<a class="textblock__info-btn btn"
href="{{ $l['button']['url'] }}"
target="{{ $l['button']['target'] }}"
title="{{ $l['button']['title'] }}"
@if($l['button_icon'] == 'btn__icon_dl')
download
@endif>
>
{{ $l['button']['title'] }}
<i class="btn__icon {{ $l['button_icon'] }}"></i>
</a>
@endif
</div>
@endif
<div class="textblock__info textblock__block">
@if(!empty($l['title']))
<h3 class="textblock__info-title subtitle">{{ $l['title'] }}</h3>
@endif
@if(!empty($l['text']))
<div @class([
'textblock__info-description description',
'quote__text' => $l['quote'] == 1
])>
@if($l['quote'] == 1)
{{ strip_tags($l['text']) }}
@else
{{ $l['text'] }}
@endif
</div>
@endif
@if(!empty($l['quote_author']) && $l['quote'] == 1)
<div class="textblock__info-author quote__author">{{ $l['quote_author'] }}</div>
@endif
@if(!empty($l['button']['url']) && $l["button"]["title"] != "Nous Rejoindre" && (!empty($custom_class) ? $custom_class : null) != "notre-politique")
<a class="textblock__info-btn btn"
href="{{ $l['button']['url'] }}"
target="{{ $l['button']['target'] }}"
title="{{ $l['button']['title'] }}"
@if($l['button_icon'] == 'btn__icon_dl')
download
@endif>
{{ $l['button']['title'] }}
<i class="btn__icon {{ $l['button_icon'] }}"></i>
</a>
@endif
</div>
</div>
@endforeach
@endif
</div>
</div>
@endif