Documentation

Start

General use

Component bitrix:ui.sidepanel.wrapper is a wrapper for displaying target component in slider.

Let's review a standard case. Connect a complex component in the template edit.php:

$APPLICATION->IncludeComponent(
    'bitrix:crm.button.edit',
    '',
    [
        'PATH_TO_BUTTON_LIST' => $arResult['PATH_TO_BUTTON_LIST'],
        'PATH_TO_BUTTON_EDIT' => $arResult['PATH_TO_BUTTON_EDIT'],
        'PATH_TO_BUTTON_FILL' => $arResult['PATH_TO_BUTTON_FILL'],
        'PATH_TO_USER_PROFILE' => $arResult['PATH_TO_USER_PROFILE'],
        'ELEMENT_ID' => $arResult['VARIABLES']['id']
    ]
);

Adapt it for slider display:

$APPLICATION->IncludeComponent(
    'bitrix:ui.sidepanel.wrapper',
    '',
    [
        'POPUP_COMPONENT_NAME' => 'bitrix:crm.button.edit',
        'POPUP_COMPONENT_TEMPLATE_NAME' => '',
        'POPUP_COMPONENT_PARAMS' => [
            'PATH_TO_BUTTON_LIST' => $arResult['PATH_TO_BUTTON_LIST'],
            'PATH_TO_BUTTON_EDIT' => $arResult['PATH_TO_BUTTON_EDIT'],
            'PATH_TO_BUTTON_FILL' => $arResult['PATH_TO_BUTTON_FILL'],
            'PATH_TO_USER_PROFILE' => $arResult['PATH_TO_USER_PROFILE'],
            'ELEMENT_ID' => $arResult['VARIABLES']['id']
        ]
    ]
);

Call target component is wrapped in bitrix:ui.sidepanel.wrapper:

  • component name is passed in parameter POPUP_COMPONENT_NAME;
  • template name is passed in parameter POPUP_COMPONENT_TEMPLATE_NAME;
  • component parameters are passed in the parameter POPUP_COMPONENT_PARAMS.

Component recognizes that its was opened in slider and displays a formatted design. Otherwise displays a standard view on the page.

Specifics

When detailed page is saved in slider, redirect must always lead to detail page. Page address must have the parameter IFRAME=Y.

...
if ($this->request->isPost() && check_bitrix_sessid())
{
	...
	$uri = new Uri($pathToDetailPage);
	if ($this->request->get('IFRAME') == 'Y')
	{
		$uri->addParams(['IFRAME' => 'Y']);
	}

	LocalRedirect($uri->getLocator());
}
...

Useful options

All options are enabled via component parameters.

  • Supported areas pagetitle, inside_pagetitle and sidebar. The same areas, as in the bitrix24 site template.
  • When you use these areas in your components, do not forget to check current site template by constant SITE_TEMPLATE_ID.
  • Additionally, only slider has the accessible area left-panel. It can be used jointly with the parameter PAGE_MODE=false.

See Also



© «Bitrix24», 2001-2024
Up