Answer the question
In order to leave comments, you need to log in
How to make a submenu from a specific section?
Hello!
in the infoblock "Catalog" the following structure is now:
section1
--subsection11
--subsection12
--subsection13
section2
--subsection21
--subsection22
--subsection23
section3
--subsection31
--subsection32
--subsection33
How to display only child sections of section2 in the drop-down menu?
That is, in the main menu, when hovering over the "catalog", a submenu should appear with the items subsection21, subsection22,
subsection23
Answer the question
In order to leave comments, you need to log in
It's easier for you to just get a list of the necessary sections and form a menu.
Use CIBlockSection::GetList you should get something like this:
$rsSections = CIBlockSection::GetList(
Array(),
Array(
"IBLOCK_ID" => "Твой инфоблок",
"SECTION_ID" => "ID раздела-родителя",
"DEPTH_LEVEL" => "2" //Скорее всего будет 2, не помню с 0 или с 1 считается
)
);
while($arSection => $rsSections->GetNext()) {
//перебираешь секции и формируешь массив для меню.
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question