Y
Y
Yuri Tatarkin2016-07-18 12:18:43
Blogs
Yuri Tatarkin, 2016-07-18 12:18:43

Own rss for blogs in bitrix?

Made rss feed for blogs on bitrix

$APPLICATION->IncludeComponent("bitrix:blog.rss","",Array(...));?>

Everything is easy and works great. Until it was required to cut off the text of the article given in rss. Let's go to the component and look at the code:
$textRSS = CBlog::BuildRSS($arBlog["ID"], $arResult["TYPE"], $arParams["MESSAGE_COUNT"], $arParams["PATH_TO_BLOG"], $arParams["PATH_TO_POST"], $arParams["PATH_TO_USER"], $bSoNet, $arFeedParams);

That is, ready-made xml comes here. We spin further:
https://bxapi.ru/src/?module_id=blog&name=CBlog::B...
//    CBlog::BuildRSS()
//    /bitrix/modules/blog/general/blog.php:1100

And here is the line where the text gets into rss is formed.
$blogDescr = htmlspecialcharsbx($arBlog["DESCRIPTION"]);

As a result, making a copy of the component did not go anywhere else. I do not really want to make another copy of the module. Is it possible to somehow get by with a little blood?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2016-07-18
@babarun

Make a copy of the BuildRSS method, place it for example in init.php (not the best option, but it will work for the first time), name it, for example, BuildRSSCustom and use it in a custom component:

$textRSS = BuildRSSCustom($arBlog["ID"], $arResult["TYPE"], $arParams["MESSAGE_COUNT"], $arParams["PATH_TO_BLOG"], $arParams["PATH_TO_POST"], $arParams["PATH_TO_USER"], $bSoNet, $arFeedParams);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question