<?php
/** @var \Blackbird\MenuManager\Block\NodeType\Group $block */ ?>
<?php
if ($block->getStatus()): ?>
    <li class="<?= implode(' ', $block->getClasses()) ?>">
        <?php
        if ($block->getLinkFirstChild() && $block->getData('url') && !($block->getData('url') == '/')): ?>
            <a href=<?= $block->getData('url') ?> class="<?= implode(' ', $block->getClasses()) ?>" target=<?= $block->getTarget() ?> role="menuitem">
                <span><?= $block->getTitle() ?></span>
            </a>
        <?php
        else: ?>
            <a class="<?= implode(' ', $block->getClasses()) ?>" target=<?= $block->getTarget() ?> role="menuitem">
                <span><?= $block->getTitle() ?></span>
            </a>
        <?php endif; ?>

        <?php
        if ($block->getChildren()): ?>
            <ul class="level<?= $block->getLevel() ?> submenu">
                <?= $block->getData('children') ?>
            </ul>
        <?php endif; ?>
    </li>
<?php endif; ?>