{assign var = foreach_name value = "menu`$level`"} {foreach from = $menu item = "menuItem" name = $foreach_name} {* li class *} {assign var = "class" value = ""} {if $menuItem.sub} {assign var = "class" value = "`$class` dropdown"} {if $menuItem.sub && $level > 1} {assign var = "class" value = "`$class`-submenu"} {else} {if $smarty.foreach.$foreach_name.last} {assign var = "class" value = "`$class` last"} {/if} {/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.hasBlocks == 'n' && $menuItem.redirect == 'n'} {assign var = "url" value = "#"} {else} {assign var = "url" value = $menuItem.url} {/if} {if $menuItem.xClassName} {assign var = "class" value = "`$class` `$menuItem.xClassName`"} {/if} {if empty($menuItem.sub)} {$menuItem.menuTitle} {else} {if $level == 1} {$menuItem.menuTitle} {else} {$menuItem.menuTitle} {/if} {/if} {/foreach}