Answer the question
In order to leave comments, you need to log in
How to create an information block in Bitrix?
Cannot create a new information block using the API.
$ib = new CIBlock;
$arFields = Array(
"ACTIVE" => 'Y',
"NAME" => 'Кирпичи',
"CODE" => 'catalog_bricks',
"LIST_PAGE_URL" => '#SITE_DIR#/catalog/list.php?SECTION_ID=#SECTION_ID#',
"DETAIL_PAGE_URL" => '#SITE_DIR#/catalog/detail.php?ID=#ELEMENT_ID#',
"IBLOCK_TYPE_ID" => 'catalog',
"SITE_ID" => Array("ru"),
"SORT" => 500,
"PICTURE" => '',
"DESCRIPTION" => '',
"DESCRIPTION_TYPE" => '',
"GROUP_ID" => Array("2"=>"D", "3"=>"R"),
);
$res = $ib->Add($arFields);
Answer the question
In order to leave comments, you need to log in
Output $ib->LAST_ERROR after executing your code and look at the text of the error that Bitrix gives you. Correct the code according to the error.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question