E
E
eternalfire2017-10-18 16:26:47
1C-Bitrix
eternalfire, 2017-10-18 16:26:47

How to add an entry to the infoblock via the API?

Suppose I parse the page with a script, I have output data: preview image, news title, text, auto, tags, etc. Now how to create a record in the news infoblock, of course, so that all the corresponding fields are filled in

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2017-10-18
@eternalfire

https://dev.1c-bitrix.ru/api_help/iblock/classes/c...

<?
$el = new CIBlockElement;

$arLoadProductArray = Array(
  "IBLOCK_ID"      => ,
  "NAME"           => ,
  "PREVIEW_TEXT"   => ,
  "DETAIL_TEXT"    => ,
  "DETAIL_PICTURE" => ,
  );

if($PRODUCT_ID = $el->Add($arLoadProductArray))
  echo "New ID: ".$PRODUCT_ID;
else
  echo "Error: ".$el->LAST_ERROR;
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question