I
I
Ivan Eremin2018-12-08 14:15:07
1C-Bitrix
Ivan Eremin, 2018-12-08 14:15:07

How to associate detailed "news" with catalog items by their properties?

There is a complex catalog with elements. The elements have the property AKTIV_VESH3 , which is selected from the information block "references" "active substances"
There is a page that displays a list of active substances through the "news" component and the detailed "news".
The catalog element contains incl. a number of active substances and a link to go to a detailed description, respectively, on the detailed page of the news.
Now I have a question to place on the detailed page of the news catalog items that include AKTIV_VESH3
How to do it within the Bitrix components? Or write a bike in result_modifier.php and component_epilog.php

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem, 2018-12-08
@divanus

In order not to involve in the cached area of ​​the template, the best option (of course, in my opinion) is to make an additional element of the $arResult array in result_modifier , which will be proxied to component_epilog (how this is done - Google "result_modifier and component_epilog at the same time"). And already by the value of this variable, make a filter for the news list component, which we place in component_epilog
upd solution from the comment thread

// глобальный массив для фильтра
global $arNewsFilter;
// массив в котором мы устанавливаем фильтр по свойству AKTIV_VESH3 который будет соответствовать текущему айдишнику новости
$arNewsFilter = Array ("PROPERTY_AKTIV_VESH3" => $arResult["ID"]);
?>

I
I'm Yoda, 2018-12-08
@Anadi

Use the element binding property

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question