J
J
jaakirqweo212021-05-12 17:43:07
1C-Bitrix
jaakirqweo21, 2021-05-12 17:43:07

Bitrix catalog, how to display a section and its elements on one page?

How to display sections and their elements in a catalog?
By type
-Section-
--Items--
-Section-
--Items--

As in the screenshot
609bef65be637627725872.png

, I displayed sections, but now how to link elements to sections?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yaroslav Alexandrov, 2021-05-13
@alexyarik

This task is called grouping the elements in an array by section. In Bitrix exam No. 2 there is such a task in the tickets. In the news.list component, for example, in the result_modifier.php file, you process the data and form your resulting array:
1. Pull out the sections
2. Pull out the elements
3. Group the elements by section. We form our own key in which we build links section - elements, while maintaining the sorting of elements
4. In the template of the component, you form the output in the desired form.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question