view-source: sblregion.ru

I will explain a little. The site works on bitrix, breaks appear only after performing the menu, remove the menu and all the rules. But no problems were found in the code of the menu itself and the surrounding elements, so what can create such breaks? Are there any options for anyone?

Here

<div class="adaptiv"> <?$APPLICATION->IncludeComponent("bitrix:menu", "main_responsive", Array( "ROOT_MENU_TYPE" => "top", // Тип меню для первого уровня "MENU_CACHE_TYPE" => "N", // Тип кеширования "MENU_CACHE_TIME" => "3600", // Время кеширования (сек.) "MENU_CACHE_USE_GROUPS" => "Y", // Учитывать права доступа "MENU_CACHE_GET_VARS" => "", // Значимые переменные запроса "MAX_LEVEL" => "1", // Уровень вложенности меню "CHILD_MENU_TYPE" => "left", // Тип меню для остальных уровней "USE_EXT" => "N", // Подключать файлы с именами вида .тип_меню.menu_ext.php "DELAY" => "N", // Откладывать выполнение шаблона меню "ALLOW_MULTI_SELECT" => "N", // Разрешить несколько активных пунктов одновременно ), false );?> </div> 

Inclusion content

 <?if (!empty($arResult)):?> <ul id="menu__adaptiv"> <? $previousLevel = 0; foreach($arResult as $arItem):?> <?if ($previousLevel && $arItem["DEPTH_LEVEL"] < $previousLevel):?> <?=str_repeat("</ul></li>", ($previousLevel - $arItem["DEPTH_LEVEL"]));?> <?endif?> <?if ($arItem["IS_PARENT"]):?> <?if ($arItem["DEPTH_LEVEL"] == 1):?> <li class="menu__adaptiv_item <?if ($arItem["SELECTED"]):?>selected<?endif?>"> <a class="menu__adaptiv_link" href="<?=$arItem["LINK"]?>"> <span class="adap_plus"><?=$arItem["TEXT"]?></span> </a> <ul class="adaptiv_menu"> <?else:?> <li class="adaptiv_menu_item <?if ($arItem["SELECTED"]):?>selected<?endif?>"><a href="<?=$arItem["LINK"]?>" class="adaptiv_menu_link parent"><?=$arItem["TEXT"]?></a> <ul> <?endif?> <?else:?> <?if ($arItem["PERMISSION"] > "D"):?> <?if ($arItem["DEPTH_LEVEL"] == 1):?> <li class="menu__adaptiv_item <?if ($arItem["SELECTED"]):?>selected<?endif?>"><a href="<?=$arItem["LINK"]?>" class="menu__adaptiv_link"><span><?=$arItem["TEXT"]?></span></a></li> <?else:?> <li class="adaptiv_menu_item <?if ($arItem["SELECTED"]):?>selected<?endif?>"><a href="<?=$arItem["LINK"]?>" class="adaptiv_menu_link"><?=$arItem["TEXT"]?></a></li> <?endif?> <?else:?> <?if ($arItem["DEPTH_LEVEL"] == 1):?> <li class="menu__adaptiv_item"><a href="" class="menu__adaptiv_link denied" title="<?=GetMessage("MENU_ITEM_ACCESS_DENIED")?>"><?=$arItem["TEXT"]?></a></li> <?else:?> <li class="adaptiv_menu_item"><a href="" class="adaptiv_menu_link denied" title="<?=GetMessage("MENU_ITEM_ACCESS_DENIED")?>"><?=$arItem["TEXT"]?></a></li> <?endif?> <?endif?> <?endif?> <?$previousLevel = $arItem["DEPTH_LEVEL"];?> <?endforeach?> <?if ($previousLevel > 1)://close last item tags?> <?=str_repeat("</ul></li>", ($previousLevel-1) );?> <?endif?> </ul> <?endif?> <a class="menu__adaptiv_close"><img src="/i/close.png" alt=""></a> 
  • 2
    what do you call rupture? if these are “gaps” between elements in the output, you can show both options: how was it normal and how was it spoiled? - Alexander Belinsky
  • @AlexanderBelinsky The author, apparently, understands the gap as about 700 blank lines between the lines <div class="adaptiv"> and <ul id="menu__adaptiv"> in the source code of the page given to the browser. It looks really original. - Yaant
  • @Yaant There are two more of the same about 700 lines further - Darth
  • Do you rule files through admin panel or via SFTP? - Oleksandr
  • @Oleksandr filezilla - bp_gusar

2 answers 2

Try to solve the problem like this:

 <?php ob_start(); $APPLICATION->IncludeComponent("bitrix:menu", "main_responsive", Array( "ROOT_MENU_TYPE" => "top", // Тип меню для первого уровня "MENU_CACHE_TYPE" => "N", // Тип кеширования "MENU_CACHE_TIME" => "3600", // Время кеширования (сек.) "MENU_CACHE_USE_GROUPS" => "Y", // Учитывать права доступа "MENU_CACHE_GET_VARS" => "", // Значимые переменные запроса "MAX_LEVEL" => "1", // Уровень вложенности меню "CHILD_MENU_TYPE" => "left", // Тип меню для остальных уровней "USE_EXT" => "N", // Подключать файлы с именами вида .тип_меню.menu_ext.php "DELAY" => "N", // Откладывать выполнение шаблона меню "ALLOW_MULTI_SELECT" => "N", // Разрешить несколько активных пунктов одновременно ), false ); $out = ob_get_contents(); ob_end_clean(); ?> <?=trim($out);?> 
  • Alas, but does not fit - bp_gusar

RESOLVED: I switched to editing the menu items "as a file" and found about 700 lines of spaces there! 4 days looking for a problem.