@extends('layouts.app') @section('title', __('navigation.search_page_title')) @section('meta_description', __('navigation.search_placeholder')) @section('content') @php $q = trim($query ?? ''); $hasEnoughLength = mb_strlen($q) >= 3; /** Texte riche stocké avec entités HTML (é etc.) : décodage pour affichage lisible dans {{ }} */ $searchExcerpt = function (?string $html, int $limit = 160): string { $plain = strip_tags((string) $html); $plain = html_entity_decode($plain, ENT_QUOTES | ENT_HTML5, 'UTF-8'); $plain = trim(preg_replace('/\s+/u', ' ', $plain)); return \Illuminate\Support\Str::limit($plain, $limit); }; $searchPlain = function (?string $text): string { return html_entity_decode(trim((string) $text), ENT_QUOTES | ENT_HTML5, 'UTF-8'); }; @endphp
@if(!$hasEnoughLength)

{{ __('navigation.search_min_length') }}

@elseif($results['total_count'] === 0)

{{ __('navigation.search_no_results') }}

@else

{{ __('navigation.search_results_for', ['q' => $q]) }}

@if($results['trainings']->isNotEmpty())

{{ __('navigation.search_section_trainings') }}

@endif @if($results['pages']->isNotEmpty())

{{ __('navigation.search_section_pages') }}

    @foreach($results['pages'] as $page) @php $pageExcerpt = $page->teaser ?: $page->content; @endphp
  • {{ $searchPlain($page->title) }} @if($pageExcerpt)

    {{ $searchExcerpt($pageExcerpt) }}

    @endif
  • @endforeach
@endif @if($results['news']->isNotEmpty())

{{ __('navigation.search_section_news') }}

@endif @if($results['faqs']->isNotEmpty())

{{ __('navigation.search_section_faq') }}

@endif @if($results['team']->isNotEmpty())

{{ __('navigation.search_section_team') }}

@endif @endif
@endsection