Simindey
3/10/2017 - 5:54 PM

Шаблон вывода вертикального меню

Шаблон вывода вертикального меню

<?
$parent = 1;
$open_sub = 0;
?>

	<nav class="menu_side"><ul>
		<?foreach($arResult[SECTIONS] as $arSection):?>
			<?if($arSection[CODE] != "event" && $arSection[CODE] != "sale" && $arSection[CODE] != "new"):?>
				<? $parent = $arSection[RIGHT_MARGIN] - $arSection[LEFT_MARGIN]; ?>
				<? if($arSection[DEPTH_LEVEL] == 1){ $name_top_s = $arSection[NAME]; }?>
				<?if($arSection[DEPTH_LEVEL] < $dpl && $open_sub == 1):?>
					<? $open_sub = 0; ?>
					</ul></div></li>
				<?endif;?>

				<li><a href="<?=$arSection[SECTION_PAGE_URL]?>" <?if($open_sub != 1):?>class="menu_block"<?endif;?> ><?=$arSection[NAME]?></a>

				<?if($parent > 1 && $arSection[DEPTH_LEVEL] != 2 && $arParams[TOP_DEPTH] > 1):?>
					<? $open_sub = 1; ?>
					<div class="menu_open_block"><div class="menu_open_head"><?=$name_top_s?></div><ul>
				<?else:?>
					</li>
				<?endif;?>

				<? $dpl = $arSection[DEPTH_LEVEL]; ?>
			<?endif;?>
		<?endforeach;?>
	</ul></nav>