ldc-groupe/resources/views/front/pages/home.blade.php
2026-01-20 10:39:46 +01:00

131 lines
5.3 KiB
PHP

@extends('front.layouts.layout')
@section('title', data_get($dynamicPageModel, 'content.list_seo_fields.0.string_seo_title'))
@section('description', data_get($dynamicPageModel, 'content.list_seo_fields.0.textarea_seo_description'))
@section('content')
{{-- VIDEO --}}
@if (data_get($dynamicPageModel, 'content.list_section_presentation'))
@php
$video = [
'show_block' => true,
'title' => $dynamicPageModel->content['list_section_presentation'][0]['string_title'],
'subtitle' => [
'text' => $dynamicPageModel->content['list_section_presentation'][0]['string_subtitle'],
'cursive' => true,
],
'video' => isset($dynamicPageModel->content['list_section_presentation'][0]['youtubeid_video'])
? $dynamicPageModel->content['list_section_presentation'][0]['youtubeid_video']
: $dynamicPageModel->content['list_section_presentation'][0]['vimeoid_video'],
'type_video' => isset($dynamicPageModel->content['list_section_presentation'][0]['youtubeid_video']) ? 'youtube' : 'vimeo',
'texte' => ''
];
@endphp
<x-front.videobloc :video="$video" />
@endif
{{-- ENGAGEMENTS --}}
@if(data_get($dynamicPageModel, 'content.list_section_our_commitments'))
@php
$engagements = [
'title' => $pageNosEngagements->title,
'subtitle' => '',
'text' => data_get($dynamicPageModel, 'content.list_section_our_commitments.0.wysiwyg_content'),
'button' => [
'title' => $pageNosEngagements->title,
'url' => \App\Helpers\RouteHelper::routeNameChecker("front.dynamic-pages.$pageNosEngagements->id_key"),
'target' => '',
],
];
@endphp
<x-front.commitments.wrapper :engagements="$engagements" />
@endif
{{-- KEY FIGURES --}}
@if(data_get($pageNousConnaitre, 'content.list_section_key_figures.0'))
<x-front.key-figures :keyFigures="data_get($pageNousConnaitre, 'content.list_section_key_figures.0')" />
@endif
{{-- VALUES --}}
@if(data_get($pageNousConnaitre, 'content.list_section_our_values.0'))
<x-front.values :title="data_get($pageNousConnaitre, 'content.list_section_our_values.0.string_title')"
:list="data_get($pageNousConnaitre, 'content.list_section_our_values.0.list_values')" />
@endif
{{-- TEXT BLOCK --}}
@if (data_get($dynamicPageModel, 'content.list_section_together'))
@php
$blocks = [
'hide_block' => false,
'title' => $dynamicPageModel->content['list_section_together'][0]['string_title'],
'subtitle' => [
'text' => $dynamicPageModel->content['list_section_together'][0]['string_subtitle'],
'cursive' => true,
],
'bg' => true,
'list' => [],
];
foreach($dynamicPageModel->content['list_section_together'][0]['list_content_block'] as $keyContent => $content) {
$positionMedium = intval($content['list_medium'][0]['position_medium']);
array_push($blocks['list'], [
'title' => $content['string_title'] ?? null,
'text' => $content['wysiwyg_description'],
'quote' => 0,
'swap_position' => $positionMedium === \App\Enums\ElementPositionEnum::showbottom->value()
? true
: $positionMedium === \App\Enums\ElementPositionEnum::showright->value(),
'in_row' => $positionMedium === \App\Enums\ElementPositionEnum::showbottom->value(),
'floated' => 0,
'align_center' => 1,
'borders_desktop' => [
'left' => true,
'right' => true,
'top' => true,
'bottom' => true,
],
'borders_mobile' => [
'left' => true,
'right' => true,
'top' => true,
'bottom' => true,
],
'image' => [
[
'url' => $content['list_medium'][0]['image_picture'],
'alt' => $content['list_medium'][0]['string_alt'],
],
],
'button' => [
'title' => $content['list_button'][0]['string_label'],
'url' => $content['list_button'][0]['url_link'],
'target' => '_blank',
],
'button_icon' => 'btn__icon_arrow-right',
]);
}
@endphp
<x-front.text-block :textBlock="$blocks" />
@endif
{{-- BRANDS --}}
@php
$brands = [];
if (
isset($pageNosMarques)
&& data_get($pageNosMarques, 'content.list_our_big_brands.0.list_brands')
) {
foreach (data_get($pageNosMarques, 'content.list_our_big_brands.0.list_brands') as $key => $logo) {
array_push($brands, [
'image' => [
'url' => asset($logo['list_logo'][0]['image_brand_logo']),
],
'link' => \App\Helpers\RouteHelper::routeNameChecker('front.dynamic-pages.nos-marques'),
]);
}
}
@endphp
@if(isset($pageNosMarques) && !empty($brands))
<x-front.brands-icons.brands-icons :brands="$brands" :title="$pageNosMarques->title" />
@endif
@endsection