{assign var = foreach_name value = "menu`$level`"} {foreach from = $menu item = "menuItem" name = $foreach_name} {* li class *} {assign var = "class" value = $menuItem.liClass} {if $menuItem.sub} {assign var = "class" value = "`$class` dropdown"} {*if $menuItem.sub && $level > 1} {assign var = "class" value = "`$class`-submenu"} {/if*} {/if} {if $menuItem.fullAlias == $CURRENT_PAGE || ($CURRENT_PAGE|strpos:"`$menuItem.fullAlias`/" === 0 && $menuItem.fullAlias != $parentFullAlias) || ($CURRENT_PAGE == '' && $menuItem.isRoot == 'y')} {assign var = "class" value = "`$class` active"} {/if} {* link target *} {assign var = "target" value = ""} {if $menuItem.redirect == 'y'} {assign var = "target" value = $menuItem.redirectAlias|target} {elseif $menuItem.target} {assign var = "target" value = $menuItem.target} {/if} {* link url *} {if $menuItem.redirect == 'y'} {assign var="url" value = $menuItem.redirectAlias} {elseif $menuItem.hasBlocks == 'n'} {assign var="url" value = '#'} {else} {assign var="url" value = $menuItem.url} {/if} {if $level == 1}{/if} {if empty($menuItem.sub)} {if $level == 1} {$menuItem.menuTitle} {else} {$menuItem.menuTitle} {/if} {else} {if $level == 1} {else} {$menuItem.menuTitle} {/if} {if $level == 1} {/if} {/if} {if $level == 1}{/if} {/foreach}