Documentation

setForSite

Attention! We strongly recommend first to learn more about Sites module REST documentation to understand how the module functions (with REST available in Bitrix24 Self-hosted editions). View this documentation as useful source when working with Bitrix24 Self-hosted editions and find out more details about API and only REST is not enough.

public function TemplateRef::setForSite(
   $id,
   $data
)

Method sets included areas for sites within a specific template (site or page must be associated to template via the field TPL_ID).

Parameters

Method Description
id Site ID.
data Array of setup data (when array is empty or is not passed, setup areas are reset). Array keys are area IDs and values are page IDs to be set as an area.

Example

if (\Bitrix\Main\Loader::includeModule('landing'))
{
   \Bitrix\Landing\TemplateRef::setForSite(
      34,
      [
         1 => 123,
         2 => 456
      ]
   );
}


© «Bitrix24», 2001-2024
Up