@extends('channels.layouts.master')
@section('content')
@php
$setting = setting();
$currentPage = $news->currentPage();
$isFirstPage = $currentPage === 1;
// প্রথম পেজে প্রথম ৪টা grid এ, বাকি list এ
// ২য় পেজ থেকে সব list এ
$gridItems = $isFirstPage ? $news->take(4) : collect([]);
$listItems = $isFirstPage ? collect($news->items())->slice(4) : collect($news->items());
@endphp
@if ($page->hasTopContent())
{!! $page->renderTopContent() !!}
@endif
{{-- PAGE TITLE --}}
{{-- TOP GRID — শুধু প্রথম পেজে --}}
@if($isFirstPage && $gridItems->count() > 0)
@foreach($gridItems as $info)
@include('global.image')
@if(isset($info->sub_title))
{{ $info->sub_title }}
@endif
{{ $info->title }}
{{ strip_tags($info->details) }}
{{ timeAgo($info->created_at) }}
@endforeach
@endif
{{-- NEWS LIST + SIDEBAR --}}
{!! loopWidgets(
'channels.partial.news-list',
collect($listItems),
$page->content_widgets ?? [],
['category' => $category ?? null, 'featured' => true]
) !!}
{{-- ✅ PAGINATION --}}
@if($news->lastPage() > 1)
@endif
{{-- END PAGINATION --}}
@if ($page->hasBottomContent())
{!! $page->renderBottomContent() !!}
@endif
@endsection