Skip to content

Commit

Permalink
fix(news): Re-use obj instead of fetching again
Browse files Browse the repository at this point in the history
This reduces the overall number of queries.
  • Loading branch information
zooley committed Mar 18, 2024
1 parent 5efa6f9 commit a1ecb72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Modules/News/Resources/views/site/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<ul class="news-list">
<?php foreach ($articles as $article): ?>
<li>
<article id="article-{{ $article->id }}" aria-labelledby="article-{{ $article->id }}-title" itemscope itemtype="https://schema.org/<?php echo ($article->type->calendar ? 'Event' : 'NewsArticle'); ?>">
<article id="article-{{ $article->id }}" aria-labelledby="article-{{ $article->id }}-title" itemscope itemtype="https://schema.org/<?php echo ($type->calendar ? 'Event' : 'NewsArticle'); ?>">
<h3 id="article-{{ $article->id }}-title" class="news-title">
<a href="{{ route('site.news.show', ['id' => $article->id]) }}"><span class="sr-only">{{ trans('news::news.article id', ['id' => $article->id]) }}:</span> <span itemprop="name">{{ $article->headline }}</span></a>
</h3>
Expand Down

0 comments on commit a1ecb72

Please sign in to comment.