Hello! Dear community, help in the implementation of the task. It is necessary to implement the automatic filling of the news information block. I smoked manuals and APIs, of course I did not find a ready solution, I tried to make my own piece of code, and of course nichrome doesn’t work, maybe there are people who have encountered such a task.

$nameNews = "Тест"; $dateNews = 20.01.2012; $contentNews = "Полное описание" $new_el = new CIBlockElement; $arLoadArray = Array( "MODIFIED_BY" => $USER->GetID(), // элемент изменен текущим пользователем "IBLOCK_SECTION_ID" => false, // элемент лежит в корне раздела "IBLOCK_ID" => 95, // ID инфоблока "NAME" => $nameNews, "ACTIVE" => "Y", // активен "DATE_ACTIVE_FROM" => $dateNews, //начало активности "PREVIEW_TEXT" => $nameNews, "PREVIEW_TEXT_TYPE" => 'html', "DETAIL_TEXT" => $contentNews, "DETAIL_TEXT_TYPE" => 'html' ); if($PRODUCT_ID = $new_el->Add($arLoadProductArray)) echo "New ID: ".$PRODUCT_ID; else echo "Error: ".$new_el->LAST_ERROR; 

When accessing the file HTTP Error 500 (Internal Server Error): An unexpected situation occurred when the server attempted to execute the request.

  • one
    and not easier to see the base and do without the monster Beatrix? - Ale_x
  • Of course, it’s easier, I completely agree, but I’m doing a functional not for myself, but for the co-intent managers:) who work only with infoblocks - Artyomich
  • @Ale_x do not imagine, forgot to put a semicolon, that's laughter))))) everything works - Artyomich

0