@extends('templates._with_sidebar')
@section('html.head.title', 'Search -')
@section('beforeMain')
@include('sections.banner', [
'background' => '',
'space_class'=>'xlg-pt4 pt3 pb3'
])
@include('atoms.heading_group', [
'title' => 'Search'
])
@include('sections.search_filters')
@include('sections.banner_CLOSE')
@endsection
@section('main')
@if (isset($results))
@if(count($results) > 0)
@foreach ($results as $result)
@if ( $result->table === 'faq_pages' ||
$result->table === 'videos' )
@include('atoms.search_link', [
"title" => "Frequently Asked Questions",
"above" => $above,
"context" => "FAQs",
"link" => $item->getUrl()
])
@elseif ( $result->table === 'template_and_forms' ||
$result->table === 'checklists' ||
$result->table === 'guide_notes' ||
$result->table === 'template_clauses')
@include('atoms.search_link', [
"title" => $item->title,
"above" => $above,
"context" => $item->getContentTypeTitle(),
"link" => $item->getUrlWithoutContext()
])
@elseif ( $result->table === 'links')
@include('atoms.search_link', [
"title" => $item->title,
"above" => $above,
"context" => $item->getContentTypeTitle(),
"link" => $item->link_source_url,
"external_link" => $item->link_source_url
])
@elseif ( $result->table === 'trustee_documents')
@include('atoms.search_link', [
"title" => $item->title,
"above" => $above,
"context" => $item->getContentTypeTitle(),
"link" => $item->getUrlWithoutContext()
])
@elseif ($result->table === 'posts')
@include('atoms.search_link', [
"title" => $item->title,
"above" => $item->published_at->format('M jS Y'),
"context" => $item->getContentTypeTitle(),
"link" => $item->getUrl()
])
@elseif ($result->table === 'primary_web_pages')
@include('atoms.search_link', [
"title" => $item->title,
"above" => $above,
"context" => $item->getContentTypeTitle(),
"link" => $item->getUrl()
])
@endif
@endforeach
@else
No results found
@endif
@endif
@endsection