T
T
txname2020-10-07 21:08:00
1C-Bitrix
txname, 2020-10-07 21:08:00

How to sort catalog sections in Bitrix alphabetically?

Hello.
Please tell me where to look and how to fix the code so that the subsections in the parent section are displayed sorted alphabetically? 5f7e03eeaff24087784143.png

file with code - https://yadi.sk/d/fP3MR1ht4uCzlQ

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail, 2020-10-08
@RuComMarket

in the component settings there should be a field associated with the first sorting and the second sorting, if the component is connected to the output of sections outside the complex one.
otherwise, you need to look deeper, where the CNextCache::CIBlockSection_GetList method is described, it might work out

CNextCache::CIBlockSection_GetList(array('SORT' => array('NAME' => 'ASC'), 'CACHE' => array("MUL.....

but it may not work, it all depends on the method
in the extreme, you can sort the array before outputting through usort, but this is already a crutch, although it is a working option

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question