I
I
iAlex1952019-05-14 10:58:37
1C-Bitrix
iAlex195, 2019-05-14 10:58:37

How to remove nesting of one menu item?

Good afternoon!
There is a multi-level menu, you need to remove nesting from one item.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Gritsuk, 2019-05-14
@winer

It depends on how the menu is formed.

  1. Displayed using the bitrix:menu component:
    • The required menu item is stored in *.menu.php files :
      Editing the menu using the built-in editor. You need to edit in "Advanced Mode".
      For the required menu item, create a parameter, for example, DISABLE_CHILD
      In the bitrix:menu component template, check this parameter
      $arItem["PARAMS"]["DISABLE_CHILD"] == "Y"

    • The required menu item is formed in the *.menu_ext.php file :
      We read the code of the *.menu_ext.php file and find where this menu item is formed. There you need to add a parameter to the array of the menu item as above.
      As an example, a menu item can be formed from IB sections in the bitrix::menu.sections component . Then we copy the component to our namespace -> in the component.php of the new component, add the code that will set such a parameter from the USER_FIELD section property. ->
      Then we perform the same check as in the previous paragraph.
    • Displayed using bitrix:catalog.section :
      Create the USER_FIELD property for the section, check for its presence in the component template.
    • It is displayed using something custom:
      we read the code, we are looking for what this menu item is. Most often, these are sections of information security (rarely elements of information security). We add USER_FIELD properties for the section or a regular property for the IB element. And only then, as before, we check their values ​​in the component template

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question