Answer the question
In order to leave comments, you need to log in
How can I catch an event in the search when there are several sections for one element?
I need to catch the event when multiple sections match for one element.
And this must be done when searching.
I began to look towards EventHandler and bitrix/php_interface/init.php
But I did not find the corresponding handlers.
At the same time, if the current literature on Bitrix is in addition to dry docks.
Answer the question
In order to leave comments, you need to log in
No. You can not. And you won't find it. Because it's not a goddamn event.
How do you imagine this event?
Mapping multiple sections to an element is a property. Well, like the color of the car. Now, if it's blue, it's not an accident. Even if he got into an accident and blue - the color is still not an accident. But if he got into an accident with a paint truck that was carrying blue paint and turned blue, then this is an accident.
Those. you can catch the event of assigning several sections to an element - for this you need to intercept the BeforeElementUpdate event, and if there is only one section or 0 remember this fact, then catch the AfterElementUpdate event and if there is more than one section - you caught it.
But it is obvious that the assignment of sections to elements does not occur during the search.
Based on the above, your question doesn't make any sense.
Apparently you meant to ask something along the lines of "Understand that an element in the found list has more than one section?" - this can be done in the template or the found elements output component. See what you need it for.
Just iterate over the elements of the list and see how many sections they have.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question