H
H
hesy2020-04-20 16:52:30
1C-Bitrix
hesy, 2020-04-20 16:52:30

How to remove standard tabs in infoblock element settings and leave your own?

How to remove Bitrix tabs and leave only those that I have defined?

Screenshot
5e9da746533f5973397706.png


There is an example of how to delete and create your own tabs: https://dev.1c-bitrix.ru/learning/course/index.php...

But I didn't quite figure it out. Therefore, since I am making a module, I did everything through it in the /local/modules/mymodule/lib/ folder and created two files with the following code:
Screenshot
5e9da8aa5f911538903654.png


But as you can see from the first screen, tabs are added, but the standard ones are not overwritten.
How to fix it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hesy, 2020-04-21
@hesy

Solution:
Create a file in the folder with the module, for example, element_tabs.php with the following content:

<?php

$aTabs = array(
    array(
        "DIV" => "tab_1",
        "TAB" => 'Таб 1',
        "ICON" => "iblock_element",
        "TITLE" => 'Таб'
    ),
    array(
        "DIV" => "tab_2",
        "TAB" => 'Таб 2',
        "ICON" => "iblock_element",
        "TITLE" => 'Таб'
    ),
);
?>

<form action="" method="post">
    <?
    $tabControl = new CAdminTabControl("tabControl", $aTabs);
    $tabControl->Begin();
    foreach ($aTabs as $tab){
        $tabControl->BeginNextTab();
        echo 'контент таба';
        $tabControl->EndTab();
    }
    $tabControl->Buttons();
    ?>

    <input type="hidden" name="saved" value="Y">
    <input type="submit" value="Сохранить">

    <? $tabControl->End(); ?>

</form>

and add this file to the infoblock type property "File with the element editing form"
And you don't need to copy the code from the core for 1700 lines as it says in the documentation

V
Vasily, 2020-04-20
@yakutec

This functionality is described in the course for content managers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question