I am faced with the task of making links headers with switching to a category in the drop-down menu on bitrix, but I don’t understand how the output of elements on the bitrix works

<div class="dropdown__group cf"> <? foreach ($arItem['SUB_MENU'] as $arItem2) : ?> <? if (isset($arResult['SECTIONS_IMG'][$arItem2['PARAMS']['ID_SECTION']])) { $arSectImg[$arResult['SECTIONS_IMG'][$arItem2['ID']]] = $arResult['SECTIONS_IMG'][$arItem2['PARAMS']['ID_SECTION']]; } ?> <ul class="dropdown__list"> /*здесь отображаются заголовки внутри меню*/ <li class="dropdown__item dropdown__item-title<? if (count($arItem2['SUB_MENU']) > 1) {?> nohover<?}?>"> <a <? if (count($arItem2['SUB_MENU']) < 1) {?> href = "<?= $arItem2['LINK'];?>"<?}?>><?= $arItem2['TEXT'] ?></a> </li> <? if ($arItem2['SUB_MENU']) : ?> <? foreach ($arItem2['SUB_MENU'] as $arItem3) : ?> <? if (isset($arResult['SECTIONS_IMG'][$arItem3['PARAMS']['ID_SECTION']])) { $arSectImg[$arResult['SECTIONS_IMG'][$arItem3['ID']]] = $arResult['SECTIONS_IMG'][$arItem3['PARAMS']['ID_SECTION']]; } ?> /*здесь отображаются заголовки внутри меню*/ /*Здесь отображаются категории меню*/ <li class="dropdown__item"><a href="<?= $arItem3['LINK'] ?>"><?= $arItem3['TEXT'] ?></a> </li> <? endforeach ?> <? endif ?> </ul> <? endforeach ?> </div> 
  • the essence of the question is not clear, if there are few levels - copy the horizontal_multilevel pattern - THE3X1LE
  • In general, this is a dropdown menu in which items are unloaded from the database. I need the headers that are in the dropdown__item-title to be categorized, tobish to become links. And the whole problem is that I can not understand how the output of elements from the database on the bitrix works and therefore I do not understand how to do the task. - Renat Klindzhev February
  • dev.1c-bitrix.ru/learning/course/… - read starting from here - "Building a menu from information blocks" And the whole article will be interesting - THE3X1LE
  • Well, thank you very much, as I read, I will unsubscribe - Renat Klindzhev February

1 answer 1

If you haven’t yet seen the menu creation examples from Bitrix, click here.

There are examples of creating a menu from the sections of information blocks.