ZEN_RSS
<?php
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
header("Content-Type: application/rss+xml; charset=utf-8");
use Bitrix\Main\Loader;
Loader::includeModule("iblock");
$iblockId = 38; // ← ID инфоблока "Статьи"
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/;>
<channel>
<title>Статьи</title>
<link>https://<?=$_SERVER["SERVER_NAME"]?>/articles/</link>
<description>RSS для Яндекс Дзена</description>
<language>ru</language>
<?php
$res = CIBlockElement::GetList(
["ACTIVE_FROM" => "DESC"],
["IBLOCK_ID" => $iblockId, "ACTIVE" => "Y"],
false,
["nTopCount" => 20],
["ID", "NAME", "DETAIL_TEXT", "DETAIL_PAGE_URL", "ACTIVE_FROM"]
);
while ($item = $res->GetNext()):
?>
<item>
<title><![CDATA[<?=$item["NAME"]?>]]></title>
<link><?="https://".$_SERVER["SERVER_NAME"].$item["DETAIL_PAGE_URL"]?></link>
<guid><?="https://".$_SERVER["SERVER_NAME"].$item["DETAIL_PAGE_URL"]?></guid>
<pubDate><?=date(DATE_RSS, strtotime($item["ACTIVE_FROM"]))?></pubDate>
<content:encoded><![CDATA[
<?=$item["DETAIL_TEXT"]?>
]]></content:encoded>
</item>
<?php endwhile; ?>
</channel>
</rss>
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
header("Content-Type: application/rss+xml; charset=utf-8");
use Bitrix\Main\Loader;
Loader::includeModule("iblock");
$iblockId = 38; // ← ID инфоблока "Статьи"
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/;>
<channel>
<title>Статьи</title>
<link>https://<?=$_SERVER["SERVER_NAME"]?>/articles/</link>
<description>RSS для Яндекс Дзена</description>
<language>ru</language>
<?php
$res = CIBlockElement::GetList(
["ACTIVE_FROM" => "DESC"],
["IBLOCK_ID" => $iblockId, "ACTIVE" => "Y"],
false,
["nTopCount" => 20],
["ID", "NAME", "DETAIL_TEXT", "DETAIL_PAGE_URL", "ACTIVE_FROM"]
);
while ($item = $res->GetNext()):
?>
<item>
<title><![CDATA[<?=$item["NAME"]?>]]></title>
<link><?="https://".$_SERVER["SERVER_NAME"].$item["DETAIL_PAGE_URL"]?></link>
<guid><?="https://".$_SERVER["SERVER_NAME"].$item["DETAIL_PAGE_URL"]?></guid>
<pubDate><?=date(DATE_RSS, strtotime($item["ACTIVE_FROM"]))?></pubDate>
<content:encoded><![CDATA[
<?=$item["DETAIL_TEXT"]?>
]]></content:encoded>
</item>
<?php endwhile; ?>
</channel>
</rss>
