<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
	<div class="container">

		<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle Navigation">
			<span class="navbar-toggler-icon"></span>
		</button>

		<div class="collapse navbar-collapse" id="navbarSupportedContent">
			<ul class="navbar-nav me-auto mb-2 mb-lg-0">
				<?php foreach($site->children()->listed() as $item): ?>
					<?php if ($item->hasListedChildren() && strcasecmp($item->slug(), "home")) { ?>
						<li class="nav-item dropdown">
							<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"><?= $item->title() ?></a>
							<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
								<?php foreach($item->children()->listed() as $child): ?>
									<li><a class="dropdown-item" href="<?= $child->url() ?>"><?= $child->title() ?></a></li>
								<?php endforeach ?>
							</ul>
						</li>
					<?php } else { ?>
						<li class="nav-item">
							<a class="nav-link" href="<?= $item->url() ?>"><?= $item->title() ?></a>
						</li>
					<?php } ?>
				<?php endforeach ?>
			</ul>
		</div>

		<div class="collapse navbar-collapse" id="navbarSupportedContent">
			<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
				<?php if ($kirby->user() && !$kirby->session()->get('kpNewUser')) { ?>

					<li class="nav-item dropdown">
						<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"><?= getFriendlyUserName() ?></a>
						<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
							<li><a class="dropdown-item" href="/user">Profile</a></li>
							<li><a class="dropdown-item" href="/logout">Logout</a></li>
						</ul>
					</li>

				<?php } else { ?>

					<li class="nav-item"><a class="nav-link" href="/login">Login</a></li>
					<li class="nav-item"><a class="nav-link" href="/register">Register</a></li>

				<?php } ?>
			</ul>
		</div>

	</div>
</nav>

<p>&nbsp;</p>
