A
A
Askfortrue2021-09-27 12:28:36
1C-Bitrix
Askfortrue, 2021-09-27 12:28:36

How to add a new custom parameter to a component?

Good afternoon experts!
Tell me how to add a new custom parameter to the component? in this case, to the Menu component.
I read it in the manual, but I didn't fully understand it, maybe it will be explained more clearly here.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Novozhilov, 2021-09-28
@kirk_novozhilov

1. Copy the bitrix:menu component template .
2. Add a sample content to the folder with your new template .parameters.php (from the standard template of the bootstrap_v4
menu component )

<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();

$arThemes = array();

$arThemesMessages = array(
  "site" => GetMessage("F_THEME_SITE"),
  "blue" => GetMessage("F_THEME_BLUE"),
  "yellow" => GetMessage("F_THEME_YELLOW"),
  "green" => GetMessage("F_THEME_GREEN"),
  "white" => GetMessage("F_THEME_LIGHT"),
  "red" => GetMessage("F_THEME_RED")
);

$arTemplateParameters = array(
  "MENU_THEME"=>array(
    "NAME" => GetMessage("MENU_THEME"),
    "TYPE" => "LIST",
    "VALUES" => $arThemesMessages,
    "PARENT" => "BASE",
  )
);
?>

Thus, we added our own parameter MENU_THEME

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question