A
A
Andrew2021-04-01 10:51:42
1C-Bitrix
Andrew, 2021-04-01 10:51:42

How to connect additional JS and CSS in the Bitrix admin panel?

How to connect additional JS and CSS in the Bitrix admin panel?
/bitrix/php_interface/admin_header.php - doesn't work for some reason...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
smilingcheater, 2021-04-01
@smilingcheater

In init.php

if (defined('ADMIN_SECTION') && ADMIN_SECTION === true) {
    $asset = \Bitrix\Main\Page\Asset::getInstance();
    $asset->addCss('/local/css/admin/style.css');
    $asset->addJs('/local/js/admin/admin.js');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question