Answer the question
In order to leave comments, you need to log in
How to set and get custom parameters of the Bitrix component settings in the $arParams array?
Task: to display the slider, the news list component is used: news.list , with the ability to set parameters: animation effects, slide transition speed, and others. These settings are set in the component settings form, and via $arParams they are obtained in the component template.
In the component template, to set and receive the necessary parameters, the .parameters.php file is created , which contains the following code:
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
$arTemplateParameters = array(
'SLIDER_EFFECT' => array(
'NAME' => 'Эффект смены слайдов',
'TYPE' => 'LIST',
'SORT' => '10',
'VALUES' => array(
'sliding' => 'Скольжение',
'fading' => 'Затухание',
),
'MULTIPLE' => 'N',
),
'SLIDER_TIME' => array(
'NAME' => 'Скорость смены слайдов (мс)',
'TYPE' => 'STRING',
'SORT' => '20',
'DEFAULT' => '5000',
),
);
Answer the question
In order to leave comments, you need to log in
I'll move my comments to an answer.
Are you sure you saved the file with the connection of this component after changing its settings?
If you look at the file where you connect the component, as PHP code, do these parameters are set in it?
You have only described these parameters so far. Until you save the component with attached parameters, they won't get into $arParams. Only what is written in the php code gets into $arParams.
It will be enough to go into the component connection settings (the window that you have in the question on the 2nd screen) and save it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question