Answer the question
In order to leave comments, you need to log in
How to create a submenu in Bitrix?
The question seems banal, but in my case, not everything is so simple. Or I'm just not well informed about this system.
As far as I know, in Bitrix the menu is formed according to the directory structure in the file system, you create a subsection on a specific page, check the box to create a menu, and it appears in the drop-down list.
But here's what I have on the site :
This is how the drop-down menu looks like:
And this is how the directory structure looks like:
I.e. the menu is formed not at all from the directory structure, but how is it formed then?
I need to do a banal thing, create a menu item About the company and name it certificates, but I can't do it. In the structure in general, both "services" and "promotions" and "payment" are inside "about the company", but the menu is formed somehow differently.
Answer the question
In order to leave comments, you need to log in
As far as I know, in Bitrix the menu is formed according to the directory structure in the file system, you create a subsection on a specific page, check the box to create a menu, and it appears in the drop-down list.but you can add it yourself, by hand.
in Bitrix, you can create a submenu that does not match the section structure by adding
$aMenuLinks = Array(
Array(
"пункт 1",
"/link1/",
Array("/link1/"),
Array(
"FROM_IBLOCK" => 1,
"IS_PARENT" => 1,
"DEPTH_LEVEL" => 1
)
),
Array(
"подпункт 1",
"/sublink1/",
Array("/sublink1/"),
Array(
"FROM_IBLOCK" => 1,
"IS_PARENT" => 0,
"DEPTH_LEVEL" => 2
)
),
);
In Bitrix, the menu can be formed by components. That is, you may have a catalog or news folder with an index file that contains a complex component.
And this component takes information from the infoblock which has sections, subsections and elements.
Accordingly, you can set up the menu so that sections/subsections become menu items/sub-items.
And it won't affect the folder structure at all. Everything will be generated dynamically.
This is an old question, but I'll answer so I don't forget myself when I need it ))
<? $APPLICATION->IncludeComponent("bitrix:menu", "horizontal_multilevel", Array(
Array(
"Пункт, из которого будет выпадать подменю",
"/parent1/",
Array(),
Array(
"FROM_IBLOCK" => 0,
"IS_PARENT" => 1,
"DEPTH_LEVEL" => 1
),
""
),
/* подменю */
Array(
"Первый пункт подменю",
"/submenu1/",
Array("/submenu1/"),
Array(
"FROM_IBLOCK" => 0,
"IS_PARENT" => 0,
"DEPTH_LEVEL" => 2
),
""
),
Array(
"Второй пункт подменю",
"/submenu2/",
Array("/submenu2/"),
Array(
"FROM_IBLOCK" => 0,
"IS_PARENT" => 0,
"DEPTH_LEVEL" => 2
),
""
),
/* конец подменю */
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question