@extends('frontend.layouts.app') @section('title') News & Events | Philippine Green Building Initiative (PGBI) @endsection @section('seo') @endsection @section('content') {{-- BANNER --}}
@if ($type == null) @elseif ($type == 'News') @elseif ($type == 'Events') @elseif ($type == 'Publications') @elseif ($type == 'Blogs') @elseif ($type == 'Awards') @elseif ($type == 'Activities') @elseif ($type == 'Resources') @endif

Media Center

{{-- FITLER PANEL --}}
{{-- ADS --}}

Place ad here

Place ad here

{{-- BLOG FEED --}}
@if ($type == null)
@foreach ($blogs as $items)
@if ($items->image != null) @else @endif
@php $createdAt = $items->created_at; if ($createdAt->isToday()) { $formattedDate = 'Today'; } else { $formattedDate = $createdAt->format('M j'); } @endphp
{{ $formattedDate }}
{{ Str::limit(strip_tags($items->title), 50, '...') }}
{{ Str::limit(html_entity_decode(strip_tags($items->description)), 80, '...') }}
@endforeach
@elseif ($type == 'News') @if (count($blogs) > 0) @php $firstBlog = $blogs[0]; $createdAt = $firstBlog->created_at; if ($createdAt->isToday()) { $formattedDate = 'Today'; } else { $formattedDate = $createdAt->format('M j'); } @endphp @endif @foreach ($blogs->skip(1) as $blog) @php $createdAt = $blog->created_at; if ($createdAt->isToday()) { $formattedDate = 'Today'; } else { $formattedDate = $createdAt->format('M j'); } @endphp @endforeach @elseif ($type == 'Events') @if (count($blogs) > 0) @php $firstBlog = $blogs[0]; $createdAt = $firstBlog->created_at; if ($createdAt->isToday()) { $formattedDate = 'Today'; } else { $formattedDate = $createdAt->format('M j'); } @endphp
@if ($firstBlog->image != null) @else @endif
@if ($formattedDate == 'Today')
{{ $formattedDate }}
@else
{{ $createdAt->format('M') }}
{{ $createdAt->format('d') }}
@endif
@endif
@foreach ($blogs->skip(1) as $blog) @php $createdAt = $blog->created_at; if ($createdAt->isToday()) { $formattedDate = 'Today'; } else { $formattedDate = $createdAt->format('M j'); } @endphp
@if ($blog->image != null) @else @endif
@if ($formattedDate == 'Today')
{{ $formattedDate }}
@else
{{ $createdAt->format('M') }}
{{ $createdAt->format('d') }}
@endif
@endforeach
@elseif ($type == 'Publications')
@foreach ($blogs as $items) @php $createdAt = $items->created_at; if ($createdAt->isToday()) { $formattedDate = 'Today'; } else { $formattedDate = $createdAt->format('M j'); } @endphp @endforeach
@elseif ($type == 'Blogs')
@foreach ($blogs as $items) @php $createdAt = $items->created_at; if ($createdAt->isToday()) { $formattedDate = 'Today'; } else { $formattedDate = $createdAt->format('M j'); } @endphp @endforeach
@elseif ($type == 'Awards')
@foreach ($blogs as $items) @php $createdAt = $items->created_at; if ($createdAt->isToday()) { $formattedDate = 'Today'; } else { $formattedDate = $createdAt->format('M j'); } @endphp @endforeach
@elseif ($type == 'Activities')
@foreach ($blogs as $items) @php $createdAt = $items->created_at; if ($createdAt->isToday()) { $formattedDate = 'Today'; } else { $formattedDate = $createdAt->format('M j'); } @endphp @endforeach
@elseif ($type == 'Resources')
@foreach ($blogs as $items) @php $createdAt = $items->created_at; if ($createdAt->isToday()) { $formattedDate = 'Today'; } else { $formattedDate = $createdAt->format('M j'); } @endphp @endforeach
@endif
@endsection @section('js') @endsection