D
D
Dmitry Klimantovich2021-05-21 17:27:24
1C-Bitrix
Dmitry Klimantovich, 2021-05-21 17:27:24

How to add a button to the admin panel with a variation of the color scheme in the Bitrix template?

In the standard template in the admin panel there is a button for switching colors.
60a7c26b10a8d781168552.png
How can I add a button with another color there?

So far, I've managed to just add a color and force it to be activated by replacing the parameter in the line in the header.php file in the template files:

if (isset($_GET["theme"]) && in_array($_GET["theme"], array("blue", "green", "yellow", "red", "gray")))
{
  COption::SetOptionString("main", "wizard_eshop_bootstrap_theme_id", $_GET["theme"], false, SITE_ID);
}
$theme = COption::GetOptionString("main", "wizard_eshop_bootstrap_theme_id", "green", SITE_ID);
<body class="bx-background-image bx-theme-<?=$theme?>" <?$APPLICATION->ShowProperty("backgroundImage");?>>

like this
COption::SetOptionString("main", "wizard_eshop_bootstrap_theme_id", "gray", false, SITE_ID);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question