add related articles to detail views

This commit is contained in:
Tobias Brunner 2025-06-06 15:22:02 +02:00
parent b456816035
commit 18e9156683
No known key found for this signature in database
8 changed files with 140 additions and 0 deletions

View file

@ -64,9 +64,15 @@ def provider_detail(request, slug):
)
)
# Get related articles for this cloud provider
related_articles = provider.articles.filter(is_published=True).order_by(
"-created_at"
)[:3]
context = {
"provider": provider,
"services": services,
"ordered_offerings": ordered_offerings,
"related_articles": related_articles,
}
return render(request, "services/provider_detail.html", context)