M
M
m1zysh0w2017-07-09 11:45:36
1C-Bitrix
m1zysh0w, 2017-07-09 11:45:36

How to add a new parent menu to the Bitrix admin panel?

Good day. I would like to ask how to add a parent menu (section) to the Bitrix admin panel? How to do it, I attached a screenshot!e21e5bbca64b4b2b949a68dca742ab11.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom Luchnikov, 2017-07-09
@m1zysh0w

Such a button can be added via the OnBuildGlobalMenu event.
To do this, register a handler, for example, in init.php
After we add a new button to the function:

function addMenuItem(&$aGlobalMenu, &$aModuleMenu)
{
    global $USER;

    if ($USER->IsAdmin()) {

        $aGlobalMenu['global_menu_custom'] = [
            'menu_id' => 'custom',
            'text' => 'Bitrix Studio',
            'title' => 'Bitrix Studio',
            'url' => 'settingss.php?lang=ru',
            'sort' => 1000,
            'items_id' => 'global_menu_custom',
            'help_section' => 'custom',
            'items' => [
                [
                    'parent_menu' => 'global_menu_custom',
                    'sort'        => 10,
                    'url'         => 'your_new_page.php?lang=ru',
                    'text'        => 'your_new_page',
                    'title'       => 'your_new_page',
                    'icon'        => 'fav_menu_icon',
                    'page_icon'   => 'fav_menu_icon',
                    'items_id'    => 'menu_custom',
                ],
                [
                    'parent_menu' => 'global_menu_custom',
                    'sort'        => 20,
                    'url'         => 'your_new_page_2.php?lang=ru',
                    'text'        => 'your_new_page_2',
                    'title'       => 'your_new_page_2',
                    'icon'        => 'fav_menu_icon_2',
                    'page_icon'   => 'fav_menu_icon_2',
                    'items_id'    => 'menu_custom',
                ],
            ],
        ];

    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question