{{-- Vue de rendu d'une page locale à partir d'un JSON structuré. Attendu: variable $json (array) avec les clés suivantes (souples): - heading_main_title, heading_main_paragraph, heading_main_btn, heading_main_btn_url - what_we_offer_title, what_we_offer (array d'items: title,text) OU what_we_offer_point{n}_* - how_we_work_title, how_we_work_steps (array: title,text) OU how_we_work_step{n}_* - personalize_section_title, personalize_section_text, personalize_section_btn, personalize_section_btn_url - product_dev_section_title, product_dev_section_text, product_dev_section_list (array) OU product_dev_section_list_item{n} - faq_section_title, faq_section_subtitle, faq_section_btn_route, faq_section_btn_text, faq_questions (array: question,answer) OU question_{n}/answer_{n} - cta_title, cta_subtitle, cta_btn --}} @php $j = is_array($json ?? null) ? $json : []; $headingTitle = $j['heading_main_title'] ?? null; $headingText = $j['heading_main_paragraph'] ?? null; $headingBtn = $j['heading_main_btn'] ?? null; $headingBtnUrl = $j['heading_main_btn_url'] ?? null; $offerTitle = $j['what_we_offer_title'] ?? null; $offerItems = []; if (!empty($j['what_we_offer']) && is_array($j['what_we_offer'])) { $offerItems = $j['what_we_offer']; } else { for ($i=1; $i<=6; $i++) { $t = $j["what_we_offer_point{$i}_title"] ?? null; $p = $j["what_we_offer_point{$i}_text"] ?? null; if ($t || $p) $offerItems[] = ['title' => $t, 'text' => $p]; } } $howTitle = $j['how_we_work_title'] ?? null; $howSteps = []; if (!empty($j['how_we_work_steps']) && is_array($j['how_we_work_steps'])) { $howSteps = $j['how_we_work_steps']; } else { for ($i=1; $i<=6; $i++) { $t = $j["how_we_work_step{$i}_title"] ?? null; $p = $j["how_we_work_step{$i}_text"] ?? null; if ($t || $p) $howSteps[] = ['title' => $t, 'text' => $p]; } } $persTitle = $j['personalize_section_title'] ?? null; $persText = $j['personalize_section_text'] ?? null; $persBtn = $j['personalize_section_btn'] ?? null; $persUrl = $j['personalize_section_btn_url'] ?? null; $prodTitle = $j['product_dev_section_title'] ?? null; $prodText = $j['product_dev_section_text'] ?? null; $prodList = []; if (!empty($j['product_dev_section_list']) && is_array($j['product_dev_section_list'])) { $prodList = $j['product_dev_section_list']; } else { for ($i=1; $i<=6; $i++) { $it = $j["product_dev_section_list_item{$i}"] ?? null; if ($it) $prodList[] = $it; } } $faqTitle = $j['faq_section_title'] ?? null; $faqSub = $j['faq_section_subtitle'] ?? null; $faqBtnText = $j['faq_section_btn_text'] ?? null; $faqBtnRoute= $j['faq_section_btn_route'] ?? null; $faqs = []; if (!empty($j['faq_questions']) && is_array($j['faq_questions'])) { $faqs = $j['faq_questions']; } else { for ($i=1; $i<=10; $i++) { $q = $j["question_{$i}"] ?? null; $a = $j["answer_{$i}"] ?? null; if ($q || $a) $faqs[] = ['question' => $q, 'answer' => $a]; } } $ctaTitle = $j['cta_title'] ?? null; $ctaSub = $j['cta_subtitle'] ?? null; $ctaBtn = $j['cta_btn'] ?? null; @endphp {{-- Section H1 / accroche --}} @if($headingTitle || $headingText)
@if($headingTitle)

{{ $headingTitle }}

@endif @if($headingText)

{{ $headingText }}

@endif @if($headingBtn)

{{ $headingBtn }}

@endif
@endif {{-- What we offer --}} @if($offerTitle || !empty($offerItems))
@if($offerTitle)

{{ $offerTitle }}

@endif @if(!empty($offerItems)) @endif
@endif {{-- How we work --}} @if($howTitle || !empty($howSteps))
@if($howTitle)

{{ $howTitle }}

@endif @if(!empty($howSteps))
    @foreach($howSteps as $s) @php($t = $s['title'] ?? null) @php($p = $s['text'] ?? null)
  1. @if($t){{ $t }}@endif @if($p)
    {{ $p }}
    @endif
  2. @endforeach
@endif
@endif {{-- Personnalisation --}} @if($persTitle || $persText)
@if($persTitle)

{{ $persTitle }}

@endif @if($persText)

{{ $persText }}

@endif @if($persBtn)

{{ $persBtn }}

@endif
@endif {{-- Développement produit / liste --}} @if($prodTitle || $prodText || !empty($prodList))
@if($prodTitle)

{{ $prodTitle }}

@endif @if($prodText)

{{ $prodText }}

@endif @if(!empty($prodList)) @endif
@endif {{-- FAQ --}} @if($faqTitle || !empty($faqs))
@if($faqTitle)

{{ $faqTitle }}

@endif @if($faqSub)

{{ $faqSub }}

@endif @if(!empty($faqs))
@foreach($faqs as $i => $f)
{{ $f['question'] ?? 'Question' }}

{{ $f['answer'] ?? '' }}

@endforeach
@endif @if($faqBtnText)

{{ $faqBtnText }}

@endif
@endif {{-- CTA final --}} @if($ctaTitle || $ctaSub || $ctaBtn)
@if($ctaTitle)

{{ $ctaTitle }}

@endif @if($ctaSub)

{{ $ctaSub }}

@endif @if($ctaBtn)

{{ $ctaBtn }}

@endif
@endif