CDBResult GetIBlockSectionList ( int iblock_id, int section_id = false, array order = Array("LEFT_MARGIN"=>"ASC"), int cnt = 0, array arFilter = Array() );
The function returns active sections of an information block iblock_id.
Parameter | Description |
---|---|
iblock_id | The ID of an information block to search for sections. |
section_id | The ID of the parent section. To obtain the root sections of an information
block, set the parameter section_id to 0. Optional. By default (false), all records are returned without restrictions. |
order | Optional sort order. Array of the format Array(by1=>order1[,
by2=>order2 [, ..]]) where by is the field for
sorting. The field can have the following values:
Default value is Array("sort"=>"asc"). Full list of sorting fields and additional information can be found in CIBlockElement::GetList() |
cnt | Maximum number of the returned records. Optional. All records are returned by default. |
arFilter | Optional additional filter by fields in the form of Array("Filtered field"=>"Value",
...). The
Filtered field can be the following:
By default, no additional filtering applied. Full list of sorting fields and additional information can be found in CIBlockElement::GetList() |
The function returns an instance of CDBResult containing the active sections, i.e. those of active information blocks and contained in active parent sections.
<? require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); $APPLICATION->SetTitle("Catalog"); if(CModule::IncludeModule("iblock")) { // if $ID is not specified or is not a number, it is assumed to be 0; // select root sections $ID = IntVal($_GET['ID']); // select sections from the information block $BID and section $ID $items = GetIBlockSectionList($_GET['BID'], $ID, Array("sort"=>"asc"), 10); while($arItem = $items->GetNext()) { echo '<a href="catalog.php?bid='.urlencode($_get['bid']). '&ID='.$arItem['ID'].'">'.$arItem["NAME"].'</a><br>'; echo $arItem["DESCRIPTION"]."<br>"; } } else ShowError("The module is not installed"); require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php"); ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |