O
O
oink2019-12-01 17:13:49
JavaScript
oink, 2019-12-01 17:13:49

How to add dynamic filtering of the output of elements of one infoblock for related elements of another infoblock?

The bottom line is this: there are two infoblocks. One (let's call it "Tips for fishermen" for example) has a set of elements (generated from the admin panel) that are essentially nested headings, say, "How to choose a rod", "What does a bream bite on", etc. in this style. In each of these elements, you need to display the associated element of another infoblock, the elements in it are galleries. The task is to make sure that each rubric has its own gallery, linked in advance to the ID of this rubric.
Naturally, the link field was added and enabled, the required category IDs are registered in the corresponding galleries. They are called on pages using "bitrix:news.list". Without filtering, when opening each of the categories, all galleries are visible in a row, which is logical. I tried to add filtering like this (PAGE_ID is just my property,

<? $GLOBALS['arrFilter'] = array("PROPERTY_PAGE_ID"=>$arItem['ID']); ?>

Didn't help (probably because the script doesn't know what $arItem is and I can't get it to communicate). If I write statically
<? $GLOBALS['arrFilter'] = array("PROPERTY_PAGE_ID"=>"120"; ?>

then in each rubric, only the gallery is displayed, which had previously been assigned a link to the rubric with ID 120, which is also logical. So what is the right way to replace $arItem["ID"] so that each category has its own gallery?
You can not use other components, I say right away. Thanks in advance to all those who care.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RAX7, 2018-12-13
@anton_trofimov95

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question