I
I
IgorRastarov2017-03-27 16:30:59
1C-Bitrix
IgorRastarov, 2017-03-27 16:30:59

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"];) // работает.
?>

Accordingly, the same description is displayed on each page.
I have template.php
<?foreach($arResult["ITEMS"] as $arItem):?>
ВЫВОД ВСЕХ СВОЙСТВ. Имена, картинки, и т.д.
<?endforeach;?>

How can I make each page display its own description?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2017-03-28
@IgorRastarov

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 question

Ask a Question

731 491 924 answers to any question