M
M
mills2020-02-07 07:13:43
1C-Bitrix
mills, 2020-02-07 07:13:43

How to display a section so that it would not disappear when entering it?

Hello!
Wrote the output of sections 1 and 2 levels.

$tree = CIBlockSection::GetTreeList(
  $arFilter=Array('IBLOCK_ID' => $iblock['ID'], 'SECTION_ID' => $arParams["CUR_SECTION"], 'CNT_ACTIVE' => true),
  $arSelect=Array('*')
);


while($arSection = $tree->GetNext()) {
  $cont_element = CIBlockSection::GetSectionElementsCount($arSection["ID"], Array("CNT_ACTIVE"=>"Y"));

  ?>
  <li>
    <span class="link"><a href="<?=$arSection['SECTION_PAGE_URL']?>"><?=$arSection['NAME'];?></a></span>
    <span class="count"><?=$cont_element?></span>
  </li>
  <?
}


But now the problem is, for example, I go to the 1st level section and the section disappears, I go to the 2nd level and also disappears. How to do what if the sections did not disappear when entering the 1st level or the second? I hope I explained clearly

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail, 2020-02-07
@RuComMarket

calculate the partition tree separately, without a specific partition filter, and separately an entry with a specific partition filter
PS I hope I understood correctly)

Y
Yaroslav Alexandrov, 2020-02-07
@alexyarik

Why didn't catalog.section.list suit you? There you add result_modifier.php in it, add your logic and get the necessary data into the resulting array, then work with this data in the template.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question