"UF_SORT_F" in catalog.section.list?" />
A
A
anriko2020-07-04 22:32:51
1C-Bitrix
anriko, 2020-07-04 22:32:51

How to sort by "ELEMENT_SORT_FIELD" => "UF_SORT_F" in catalog.section.list?

in the admin panel in the sections I created a custom field UF_SORT_F type string, I can’t understand why sorting doesn’t work, what didn’t I do or didn’t finish?

$sectionListParams = array(
  "IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
  "IBLOCK_ID" => $arParams["IBLOCK_ID"],
  //"SECTION_ID" => $arResult["VARIABLES"]["SECTION_ID"],
  "SECTION_ID" => $arParams["SECTION_ID_CUSTOM"],
  "SECTION_CODE" => $arResult["VARIABLES"]["SECTION_CODE"],
  "CACHE_TYPE" => $arParams["CACHE_TYPE"],
  "CACHE_TIME" => $arParams["CACHE_TIME"],
  "CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
  "COUNT_ELEMENTS" => $arParams["SECTION_COUNT_ELEMENTS"],
  "TOP_DEPTH" => $arParams["SECTION_TOP_DEPTH"],
  "SECTION_URL" => $arResult["FOLDER"].$arResult["URL_TEMPLATES"]["section"],
  "SECTION_FIELDS" => array("DETAIL_PICTURE",""),
  "SECTION_USER_FIELDS" => array('UF_SORT_F','UF_SORT',"UF_SHOW_FILTER_ZNAKI"),
  "VIEW_MODE" => $arParams["SECTIONS_VIEW_MODE"],
  "SHOW_PARENT_NAME" => $arParams["SECTIONS_SHOW_PARENT_NAME"],
  "HIDE_SECTION_NAME" => (isset($arParams["SECTIONS_HIDE_SECTION_NAME"]) ? $arParams["SECTIONS_HIDE_SECTION_NAME"] : "N"),
  "ADD_SECTIONS_CHAIN" => (isset($arParams["ADD_SECTIONS_CHAIN"]) ? $arParams["ADD_SECTIONS_CHAIN"] : ''),
   "ELEMENT_SORT_FIELD" => "UF_SORT_F"
);
if ($sectionListParams["COUNT_ELEMENTS"] === "Y")
{
  $sectionListParams["COUNT_ELEMENTS_FILTER"] = "CNT_ACTIVE";
  if ($arParams["HIDE_NOT_AVAILABLE"] == "Y")
  {
    $sectionListParams["COUNT_ELEMENTS_FILTER"] = "CNT_AVAILABLE";
  }
}

$APPLICATION->IncludeComponent(
  "bitrix:catalog.section.list",
  "dorozhnye-znaki",
  $sectionListParams,
  $component,
  array("HIDE_ICONS" => "Y")
);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Vorobyov, 2020-07-06
@BXVoral

And where did you get such a parameter as ELEMENT_SORT_FIELD from?
Your component displays sections, according to the "ideology" a Bitrix parameter with this name should have sorted elements, not sections.
Meanwhile, in the dock to bitrix:catalog.section.lst it is indicated that there is a CUSTOM_SECTION_SORT parameter for custom sorting

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question