{{-- News Grid Layout Expects $content to have keys like: $content['section_title'] (optional) $content['number_of_articles'] (e.g., 3, 6) $content['view_all_link'] (optional, e.g., /news) $content['view_all_text'] (optional, e.g., Read More News) --}} @php $sectionTitle = $content['section_title'] ?? 'Latest News & Articles'; $numberOfArticles = (int)($content['number_of_articles'] ?? 3); $viewAllLink = $content['view_all_link'] ?? null; $viewAllText = $content['view_all_text'] ?? 'View All News'; // Fetch news articles. For now, assuming LpPage with a specific template or category. // Replace this with your actual News/Article model fetching logic. $articles = \Modules\LandingPage\Entities\LpPage::where('is_published', true) // ->where('theme_template', 'news_article_template') // Example filter ->orderBy('created_at', 'desc') ->take($numberOfArticles) ->get(); @endphp
@if($sectionTitle)

{{ $sectionTitle }}

@endif
@forelse($articles as $article)
{{-- Add article image if available --}}

{{ $article->title }}

{{ $article->created_at->format('M d, Y') }}

{{ Str::limit(strip_tags($article->content), 120) }}

Read More →
@empty

No news articles found.

@endforelse
@if($viewAllLink && $articles->isNotEmpty()) @endif