A
A
anriko2020-09-06 23:06:02
1C-Bitrix
anriko, 2020-09-06 23:06:02

How to display the number of subsections of a section?

so I get the number of elements, but I need active sections

if(CModule::IncludeModule("iblock")){
                        // выборка только активных разделов из инфоблока $IBLOCK_ID, $ID - раздел-родителя
                        $arFilter = Array('IBLOCK_ID'=>28, 'GLOBAL_ACTIVE'=>'Y', 'SECTION_ID'=>$arSection['ID']);
                        $db_list = CIBlockSection::GetList(Array($by=>$order), $arFilter, true);
                        while($ar_result = $db_list->GetNext())
                        {
                            echo $ar_result['ID'].' '.$ar_result['NAME'].': '.$ar_result['ELEMENT_CNT'].'<br>';
                        }
                    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2020-09-07
@babarun

https://dev.1c-bitrix.ru/api_help/iblock/classes/c...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question