{foreach $navbar as $item}
    <li data-menuItemName="{$item->getName()}" class="{$item->getId()} d-block{if $item@first} no-collapse{/if}{if $item->hasChildren()} dropdown no-collapse{/if}{if $item->getClass()} {$item->getClass()}{/if}{if $item->getName() == "Home"} home-item{/if}">
        <a class="nav-link{if !isset($rightDrop) || !$rightDrop}{/if}{if $item->hasChildren()} dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#"{else}" href="{$item->getUri()}"{/if}{if $item->getAttribute('target')} target="{$item->getAttribute('target')}"{/if}>
            {if $item->getName() == "Home"}<i class="fas fa-home"></i>{else}{if $item->hasIcon()}<i class="{$item->getIcon()}"></i>&nbsp;{/if}{/if}
            <span>{$item->getLabel()}</span>
            {if $item->hasBadge()}&nbsp;<span class="badge">{$item->getBadge()}</span>{/if}
        </a>
        {if $item->hasChildren()}
            <ul class="dropdown-menu{if isset($rightDrop) && $rightDrop} dropdown-menu-right{/if}{if $item->getName() eq "Account"} dropdown-user{/if}">
				{if $item->getName() == "Account" && $loggedin}    
					<li class="dropdown-header">
						<div class="dropdown-header-title">
							{if $cuser}
								{$cuser->fullName}
							{else}
								{$client.fullname}
							{/if}
							
						</div>
						<div class="dropdown-header-desc">
							{if $cuser}
								{$cuser->email}
							{else}
								{$client.email}
							{/if}
						</div>
					</li>
					<li class="dropdown-divider"> 
                            -----
					</li>
					<li data-menuItemName="Switch Accounts">
						<a href="{routePath('user-accounts')}" class="dropdown-item">
							<div class="dropdown-menu-item-name">{lang key='navSwitchAccount'}</div>
                        </a>
					</li>
					<li class="dropdown-divider"> 
                            -----
					</li>
				{/if}            
			
			{foreach $item->getChildren() as $childItem}
                {if $childItem->getClass() && in_array($childItem->getClass(), ['dropdown-divider', 'nav-divider'])}
                    <li class="dropdown-divider"></li>
                {else}
                    <li data-menuItemName="{$childItem->getName()}" class="{if $childItem->getClass()} {$childItem->getClass()}{/if}">
                        <a href="{$childItem->getUri()}" class="dropdown-item"{if $childItem->getAttribute('target')} target="{$childItem->getAttribute('target')}"{/if}>
                            {if $childItem->hasIcon()}<i class="{$childItem->getIcon()}"></i>&nbsp;{/if}
                            {$childItem->getLabel()}
                            {if $childItem->hasBadge()}&nbsp;<span class="badge">{$childItem->getBadge()}</span>{/if}
                        </a>
                    </li>
                {/if}
            {/foreach}
            </ul>
        {/if}
    </li>
{/foreach}