HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/ZelfVerkopen/zelfverkopen.nl/resources/views/site/partials/sitemapLoop.blade.php
@if($sitemapItem->active && (isset($landingPages) && !$landingPages && $sitemapItem->code_name != ''))

    <li>
        <a href="/{{$sitemapItem->translation->route->alias}}">{{$sitemapItem->translation->name}}</a>
    </li>

    {{-- Check if sitemap item is all the end of the tree branch --}}
    @unless($sitemapItem->rgt == $sitemapItem->lft+1)

        @php
            $childPages = new \Illuminate\Database\Eloquent\Collection($page->findChildren());
            $childPages = $childPages->load('translation', 'translation.route');
        @endphp

        {{-- Check if the sitemap item has children --}}
        @if(sizeof($childPages) != 0)

            {{-- If it does, recall this blade with the found child as item --}}
            <ul>
                @foreach($childPages as $child)
                    @include('layouts.partials.sitemapLoop', ['sitemapItem' => $child, 'landingPages' => $landingPages])
                @endforeach
            </ul>
        @endif

    @endunless

@endif