File: D:/HostingSpaces/blijegasten/blijegasten.be/resources/views/site/components/sitemapLoop.blade.php
@if($sitemapItem->active)
<li>
<a href="{{$links->{$sitemapItem->code_name}->route}}">{{$links->{$sitemapItem->code_name}->name}}</a>
{{-- Check if sitemap item is all the end of the tree branch --}}
@unless($sitemapItem->rgt == $sitemapItem->lft+1)
{{-- Check if the sitemap item has children --}}
<?php $children = $sitemapItem->findChildren(); ?>
@if(sizeof($children) != 0)
{{-- If it does, recall this blade with the found child as item --}}
<ul>
@foreach($children as $child)
@include('layouts.partials.sitemapLoop', ['sitemapItem' => $child])
@endforeach
</ul>
@endif
@endunless
@if(isset($composedCategories) && $sitemapItem->code_name == 'categories')
<ul>
@foreach($composedCategories->children as $composedCategory)
@continue(!isset($composedCategory->translation))
<li>
<a href="{{$links->categories->route}}/{{$composedCategory->translation->slug}}">{{ $composedCategory->translation->name }}</a>
@if(isset($composedCategory->children))
<ul>
@foreach($composedCategory->children as $composedSubCategory)
@continue(empty($composedSubCategory->translation))
<li>
<a href="{{$links->categories->route}}/{{$composedCategory->translation->slug}}/{{$composedSubCategory->translation->slug}}">{{$composedSubCategory->translation->name}}</a>
</li>
@endforeach
</ul>
@endif
</li>
@endforeach
</ul>
@endif
</li>
@endif