E
E
Evgeny Nikolaev2019-08-29 12:09:49
1C-Bitrix
Evgeny Nikolaev, 2019-08-29 12:09:49

How to get an array of sections (sections) to which an infoblock belongs (an element of an infoblock belongs to several sections/sections) in the news list template?

Next situation.
There is an information block. Sections (sections) are created in its root, in this case 4.
Infoblock elements are created in these sections. Further, these infoblocks are assigned to several sections (sections). I checked - the element of the infoblock is indeed now placed in several necessary folders (sections / sections).
The elements of this infoblock must be displayed in the news list, and it is required to get all the IBLOCK_SECTION_ID values, and now I only display 1 Id of the element (presumably with the lowest index or maybe by SORT - did not check).
How can I get all the IBLOCK_SECTION_IDs that an infoblock element belongs to?
The most standard solution is desirable. Maybe when calling the component, you need to add some kind of setting?
Screenshots on the issue:
5d6795f373246052778743.jpeg
5d67960c87ffc967317361.jpeg
5d6796159f747320551054.jpeg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Evgeny Nikolaev, 2019-08-29
@nikolaevevge

I just found this thing CIBlockElement::GetElementGroups, but I haven't figured out whether it works or not yet.
The question about setting up the news list component is still relevant. That is, is it possible to pass parameters to the component in such a way that without additional requests in result_modifier.php it can be dispensed with.

Y
Yaroslav Alexandrov, 2019-08-30
@alexyarik

If there are sections, then it is better to use a complex catalog, where you can easily include news list instead of catalog-section.

A
Alexander, 2019-09-04
Madzhugin @Suntechnic

It seems to be impossible.
The simplest and most productive would be CIBlockElement::GetElementGroups in result_modifier.php. I don't understand why this scares you - this is a normal decision.
Another option is component customization.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question