{{$first = TRUE;}} {{foreach $roots as $id => $item}} {{if $preview or $item->canView()}} {{$active = $preview ? $first : $item->activeOrChildActive();}} {{if $active}} {{\IPS\core\FrontNavigation::i()->activePrimaryNavBar = $item->id;}} {{endif}} {{$children = $item->children();}} {{if $children}} {$item->title()} {{else}} target()}}target='{$item->target()}'{{endif}} data-navItem-id="{$item->id}" {{if $active}}data-navDefault{{endif}} data-navApp="{expression="mb_substr( get_class( $item ), 4, mb_strpos( get_class( $item ), '\\', 4 ) - 4 )"}" data-navExt="{expression="mb_substr( get_class( $item ), mb_strrpos( get_class( $item ), '\\' ) + 1 )"}" data-psMenuKey="menu_{$item->title()}"> {$item->title()} {{endif}} {{if $subBars && isset( $subBars[ $id ] ) && count( $subBars[ $id ] )}} {{endif}} {{endif}} {{$first = FALSE;}} {{endforeach}}