<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:g="http://www.w3.org/1999/html"
      data-namespace-typo3-fluid="true">
<f:if condition="{nav}">
    <nav class="navbar navbar-{type}">
        <f:if condition="{type}=='main'">
            <f:if condition="{settings.logo.file} && {settings.logo.showIcon}">
                <f:render section="logo" arguments="{_all}"/>
            </f:if>
            <f:if condition="{settings.logo.showText}">
                <f:render section="logoText" arguments="{_all}"/>
            </f:if>

        </f:if>
        <f:render section="mainmenu" arguments="{nav:nav}"/>
    </nav>
</f:if>
<f:section name="mainmenu">
    <ul class="nav" role="menubar">
        <f:for each="{nav}" as="navItem">
            <li class="nav-item{f:if(condition: navItem.active, then: ' active')}{f:if(condition: navItem.current, then: ' current')}{f:if(condition: navItem.children, then: ' dropdown')}">
                <f:if condition="{navItem.children}">
                    <f:then>
                        <a class="nav-link dropdown-toggle" id="dropdownToggler{navItem.title}" tabindex="{i.index}" data-toggle="dropdown" data-uid="{navItem.data.uid}" aria-haspopup="true" aria-expanded="false" href="#">{navItem.title}</a>
                    </f:then>
                    <f:else>
                        <a class="nav-link" href="{navItem.link}" role="menuitem" data-uid="{navItem.data.uid}" tabindex="0">{navItem.title}</a>
                    </f:else>
                </f:if>
                <f:if condition="{navItem.children}">
                    <f:render section="submenu" arguments="{submenu: navItem.children, dropdownToggler:navItem.title}"/>
                </f:if>
            </li>
        </f:for>
    </ul>
</f:section>
<f:section name="submenu">
    <div class="dropdown-menu" aria-labelledby="dropdownToggler{dropdownToggler}">
        <f:for each="{submenu}" as="subItem">
            <a class="dropdown-item" href="{subItem.link}" title="{f:if(condition: subItem.data.abstract, then: subItem.data.abstract, else: subItem.data.description)}" data-uid="{subItem.data.uid}" role="menuitem" tabindex="-1">{subItem.title}</a>
        </f:for>
    </div>
</f:section>
<f:section name="logo">
    <f:link.page pageUid="{rootPage}" class="navbar-brand logo" title="{settings.logo.linktitle}">
        <img src="{f:uri.image(src: settings.logo.file)}" alt="{logoAlt}" height="{settings.logo.height}" width="{settings.logo.width}">
    </f:link.page>
</f:section>
<f:section name="logoText">
    <f:link.page pageUid="{rootPage}" class="navbar-brand logo logo-text" title="{settings.logo.linktitle}">
        {siteTitle}
    </f:link.page>
</f:section>
