{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.fullAlias == 'home')} {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 empty($menuItem.sub)} {$menuItem.menuTitle|htmlspecialchars} {else} {if $level == 1} {$menuItem.menuTitle|htmlspecialchars} {else} {$menuItem.menuTitle|htmlspecialchars} {/if} {/if} {/foreach}