Hi I'm new to laravel and can't understand sections
very well, but I am trying to display a specific one in a loop only once and then repeat everything else, if a certain condition is true. Here is the code I'm trying to modify. Here i commented the line which i want only one time.
@foreach ($pageTypes['news-events']->categories as $cat)
<?php $related = $page->relatedPages($pageTypes['news-events']->id, $cat->id); ?>
@if ($related->count() > 0)
@section('tab-titles')
//i want to display this LI once if true
<li class="tab first"><a href="#news" title="insight">Insight</a></li>
@append
@section('news-content')
<div id="news" class="tabs_text">
<h2>{{ strtoupper($cat->name) }}
</h2>
<ul>
@foreach($related as $news)
<li><a href="{{ url($news->url) }}" title="{{ $news->title }}">
{{ $news->title }}
</a>
</li>
@endforeach
</ul>
</div>
@append
@endif
@endforeach