Component for rendering custom fields
Description
The main version 20.0.800 provides new API for rendering custom field controls.
Calling a component and its parameters are similar for all components, only component name is changed.
All components contain templates for desktop and mobile app, support option to change control's external appearance using standard template mechanism.
Components are deemed as system components and aren't displayed in the visual editor. They can be found in the site physical structure inside the folder /bitrix/components/bitrix/[component_name]
.
List of components
Component | Description |
---|---|
iblock.field.section | Designed for rendering custom user fields iblock_section (list to iblock section) using new API. |
iblock.field.element | Designed for rendering user custom fields iblock_element (list to iblock element) using new API. |
Additional
You can also use universal API:
$renderer = new \Bitrix\Iblock\UserField\Renderer($userField, $additionalParameters); return $renderer->render();
Parameters
Parameter | Description |
---|---|
$userField | Array with user field metainformation. Can be retrieved by епу method GetUserFields of class CUserTypeManager. |
$additionalParameters | Array containing necessary settings depending on template that shows control. Specifically, this array passes the following elements:
|
Example of component call iblock.field.section
<? $APPLICATION->IncludeComponent( 'bitrix:iblock.field.section', '', [ 'userField' => $userField, 'additionalParameters' => $additionalParameters, ] ); ?>
© «Bitrix24», 2001-2024