Documentation

updateFolder

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.

Site::updateFolder(
   $siteId,
   $folderId,
   $fields
);

Method updates folder for a site.

Parameters

Parameters Description Available from version
$siteId Site ID.

Attention: Requires write access permissions for a specified site.

$folderId Folder ID in site.
$fields Folder fields:
  • ACTIVE – folder activity (Y/N). Created inactive by default;
  • TITLE – title (name) папки;
  • INDEX_ID –– folder page ID, set as folder index page;
  • CODE – folder character code (folder page URL). Transliterated from folder name by default.

Example

if (\Bitrix\Main\Loader::includeModule('landing'))
{
   $res = \Bitrix\Landing\Site::updateFolder(2076, 147, [
      'TITLE' => 'Updated folder'
   ]);
   if ($res->isSuccess())
   {
      echo 'Folder updated, identifier: ' . $res->getId();
   }
   else
   {
      foreach ($res->getErrors() as $error)
      {
         echo $error->getMessage() . '<br/>';
      }
   }
}


© «Bitrix24», 2001-2024
Up