<?php if ($this->navigation): ?>
<ul class="nav <?= $this->navClass ?: 'nav-tabs' ?>" role="tablist">
    <?php foreach($this->navigation->items() as $item): ?>
    <?php if ($item instanceof \ContaoBootstrap\Tab\View\Tab\Item\Dropdown): ?>
    <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle <?php if ($item->active()):?> active<?php endif ?>"
           href="#<?= $item->cssId() ?>"
           id="<?= $item->navCssId() ?>"
           data-toggle="dropdown"
           role="button"
           aria-haspopup="true"
           aria-expanded="false">
            <?= $item->title() ?>
        </a>
        <div class="dropdown-menu">
            <?php foreach ($item->items() as $child): ?>
            <a class="dropdown-item"
               href="#<?= $child->cssId() ?>"
               id="<?= $child->navCssId() ?>"
               data-toggle="tab"
               role="tab"
               aria-controls="<?= $child->cssId() ?>"
               aria-selected="<?= $child->active() ? 'true': 'false' ?>">
                <?= $child->title() ?>
            </a>
            <?php endforeach ?>
        </div>
    </li>
    <?php else: ?>
    <li class="nav-item">
        <a class="nav-link<?php if ($item->active()):?> active<?php endif ?>"
           href="#<?= $item->cssId() ?>"
           id="<?= $item->navCssId() ?>"
           data-toggle="tab"
           role="tab"
           aria-controls="<?= $item->cssId() ?>"
           aria-selected="<?= $item->active() ? 'true': 'false' ?>">
            <?= $item->title() ?>
        </a>
    </li>
    <?php endif ?>
    <?php endforeach ?>
</ul>
<?php endif ?>
