Integration of 1C-Bitrix with Yandex Dzen
Yandex Dzen (since 2023 — just "Dzen") accepts content from external sources via RSS feed. For an online store or content site on Bitrix, this means automatic publication of blog posts and materials to Dzen feed without manual copying. Technically, the task is to generate correct RSS and maintain its relevance.
RSS Format for Dzen
Dzen supports two feed types:
Standard RSS — content is transmitted in <description> or <content:encoded>. Dzen reads the text, formats the page itself. Limited formatting control.
RSS with native Turbo format — extended format with turbo:content, allows transmitting full HTML with images and markup. Recommended for articles with rich content.
Minimal Dzen RSS:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:turbo="http://turbo.yandex.ru">
<channel>
<title>Store Blog</title>
<link>https://example.ru/blog/</link>
<language>en</language>
<item>
<title>How to Choose Product X</title>
<link>https://example.ru/blog/how-to-choose-x/</link>
<pubDate>Fri, 13 Mar 2026 12:00:00 +0300</pubDate>
<author>[email protected] (Editorial)</author>
<turbo:content><![CDATA[
<figure>
<img src="https://example.ru/upload/iblock/abc/cover.jpg" alt="Cover">
<figcaption>Photo caption</figcaption>
</figure>
<p>Main article text...</p>
<h2>Subheading</h2>
<p>Continuation of text...</p>
]]></turbo:content>
</item>
</channel>
</rss>
Generating Feed from Bitrix Infoblock
Create page /dzen-feed.php or custom component. Example generation from "Articles" infoblock:
<?php
require($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php');
header('Content-Type: application/rss+xml; charset=utf-8');
$iblockId = BLOG_IBLOCK_ID;
$limit = 100; // Dzen recommends 50–200 latest publications
$cache = \Bitrix\Main\Data\Cache::createInstance();
$cacheKey = 'dzen_feed';
if ($cache->startDataCache(1800, $cacheKey, '/dzen')) {
$items = [];
$res = CIBlockElement::GetList(
['ACTIVE_FROM' => 'DESC'],
['IBLOCK_ID' => $iblockId, 'ACTIVE' => 'Y'],
false,
['nTopCount' => $limit],
['ID', 'NAME', 'DETAIL_PAGE_URL', 'DETAIL_TEXT',
'PREVIEW_TEXT', 'DETAIL_PICTURE', 'ACTIVE_FROM', 'TAGS']
);
while ($el = $res->GetNextElement()) {
$fields = $el->GetFields();
$props = $el->GetProperties();
$imgHtml = '';
if ($fields['DETAIL_PICTURE']) {
$file = CFile::GetFileArray($fields['DETAIL_PICTURE']);
if ($file) {
$imgHtml = '<figure><img src="https://' . SITE_SERVER_NAME
. $file['SRC'] . '" alt="'
. htmlspecialchars($fields['NAME']) . '"></figure>';
}
}
$content = $imgHtml . $fields['DETAIL_TEXT'];
$items[] = [
'title' => $fields['NAME'],
'link' => 'https://' . SITE_SERVER_NAME . $fields['DETAIL_PAGE_URL'],
'pubDate' => date('r', MakeTimeStamp($fields['ACTIVE_FROM'])),
'author' => 'editor@' . SITE_SERVER_NAME,
'content' => $content,
];
}
$cache->endDataCache(['items' => $items]);
} else {
$items = $cache->getVars()['items'];
}
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<rss version="2.0"'
. ' xmlns:content="http://purl.org/rss/1.0/modules/content/"'
. ' xmlns:turbo="http://turbo.yandex.ru">';
echo '<channel>';
echo '<title>' . htmlspecialchars(SITE_NAME) . '</title>';
echo '<link>https://' . SITE_SERVER_NAME . '/blog/</link>';
echo '<language>en</language>';
foreach ($items as $item) {
echo '<item>';
echo '<title>' . htmlspecialchars($item['title']) . '</title>';
echo '<link>' . htmlspecialchars($item['link']) . '</link>';
echo '<pubDate>' . $item['pubDate'] . '</pubDate>';
echo '<author>' . htmlspecialchars($item['author']) . '</author>';
echo '<turbo:content><![CDATA[' . $item['content'] . ']]></turbo:content>';
echo '</item>';
}
echo '</channel></rss>';
Content Requirements
Dzen has requirements for publications:
- Volume: articles under 700 characters may distribute poorly in feed
- Images: absolute URLs required, Dzen caches images on its servers
- Uniqueness: content duplication between publications reduces reach
-
Date:
<pubDate>field with correct date mandatory for proper sorting
DETAIL_TEXT in Bitrix stores HTML text processed by editor. In feed it goes as is — inside CDATA tags are not escaped. If content contains ]]> (extremely rare), replacement needed: $content = str_replace(']]>', ']]]]><![CDATA[>', $content).
Channel Setup in Dzen
- Create channel on
zen.yandex.ru(ordzen.ru) via Yandex account - In channel settings → "Sources" → "Add source" → paste feed URL
- Dzen checks feed and begins import. First publication appears within several hours
- After checking 10–50 publications, channel gets monetization capability
Monitoring and Auto-Update
Dzen crawls the feed every 15–30 minutes. Updating pubDate for already published materials is unnecessary — Dzen won't republish them. New items at the feed beginning are picked up on next crawl.
To notify Dzen about new content, send a ping request after publishing new material via OnAfterIBlockElementAdd handler:
AddEventHandler('iblock', 'OnAfterIBlockElementAdd', function(&$fields) {
if ($fields['IBLOCK_ID'] !== BLOG_IBLOCK_ID) return;
// Clear feed cache
\Bitrix\Main\Data\Cache::createInstance()->cleanDir('/dzen');
});
Implementation Timelines
| Variant | Composition | Timeline |
|---|---|---|
| Simple RSS (without turbo:content) | Feed page + cache | 0.5–1 day |
| Turbo feed with images and structure | DETAIL_TEXT parsing + image processing | 1–2 days |
| Multi-infoblock feed (articles + news + products) | Unified feed from multiple sources | 2–3 days |







