Answer the question
In order to leave comments, you need to log in
How to get first level subsections by section id?
And you need to get the value of the custom field of the sections UF_SORT_F of these internal sections of the first level
, it didn’t work out, it
gives an array without UF_SORT_F
///Array ( [NAME] => Buyers with this product [ID] => 838 [SORT] => 500 ) /// //////Array ( [NAME] => GOST [ID] => 842 [SORT] => 500 ) /////////Array ( [NAME] => Assigned [ID] => 843 [SORT] => 501 ) /////////Array ( [NAME] => By form [ID] => 845 [SORT] => 503 ) /////////Array ( [NAME] => Accessories [ID] => 844 [SORT] => 504 ) //////
if ( CModule::IncludeModule ( "iblock" ) ){
$arOrder = array("sort" => "ASC");
$arFilter = array("SECTION_ID" => 820);
$arSelect = array("NAME", "ID","UF_SORT_F");
$db_elemens = CIBlockSection::GetList ( $arOrder, $arFilter, false, $arSelect );
while ( $arElement = $db_elemens->Fetch () ) {
echo "///";
print_r($arElement);
echo $uf_value["ID"];
echo "///";
echo $uf_value["NAME"];
echo "///";
echo $uf_value["UF_SORT_F"];
echo $arElement["DESCRIPTION"];
}
}
}
if(CModule::IncludeModule("iblock"))
{
// если $ID не задан или это не число, тогда
// $ID будет =0, выбираем корневые разделы
$ID = IntVal(820);
// выберем папки из информационного блока $BID и раздела $ID
$items = GetIBlockSectionList(28, $ID, Array("UF_SORT"=>"asc"), 10);
while($arItem = $items->GetNext())
{
print_r($arItem);
echo $arItem["NAME"];
echo $arItem["UF_SORT_F"];
}
}
else
ShowError("Модуль не установлен");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question