Answer the question
In order to leave comments, you need to log in
How to display a description for each section in Bitrix?
Tell me please. I have a bitrix.news.list component.
I need to display a description of the sections. That is, there is a directory, it has
elements. I write in result_modifier.php
<?
CModule::IncludeModule('iblock');
$rsCity = CIBlockSection::GetList(array(), array("IBLOCK_ID" => 14, "ACTIVE" => "Y"), false, false, array("DESCRIPTION"));
while ($arSection = $rsSection->GetNext()) {
$arSection["DESCRIPTION"];
}
var_dump($arSection["DESCRIPTION"];) // работает.
?>
<?foreach($arResult["ITEMS"] as $arItem):?>
ВЫВОД ВСЕХ СВОЙСТВ. Имена, картинки, и т.д.
<?endforeach;?>
Answer the question
In order to leave comments, you need to log in
If there is a catalog, then try to use the complex catalog component. Well, since you have news.list - okay. The documentation says that the description of sections for bitrix.news.list can be displayed with the description of the section through the $arSection["DESCRIPTION"] variable. That is, immediately after calling the component in your index.php, insert something like this:
<?
CModule::IncludeModule("iblock");
$res = CIBlockSection::GetByID($_REQUEST["SECTION_ID"]);
if($arSection = $res->GetNext())
{
$arFilter = array (
'SECTION_ID'=> $_REQUEST["SECTION_ID"]
);
echo $arSection["DESCRIPTION"];
}
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question