Answer the question
In order to leave comments, you need to log in
How to display the elements of news.list by the value of its property?
Before calling the news component I do
$GLOBALS['arrFilter'] = ['PROPERTIES' => ['CITY_INFO' = > ['ID' => $_POST['id']]]];// пробовал так же в post[id] напрямую указать id всё равно не работает
$GLOBALS['arrFilter'] = ['ID' => 1]
Answer the question
In order to leave comments, you need to log in
This CIBlockElement::GetList function is called in the component, according to its filtering rules, and you need to use it, that is, in your situation, the filter should be like this
$GLOBALS['arrFilter'] = ['PROPERTY_CITY_INFO' => $_POST['id']];
$GLOBALS['arrFilter'] = ['=PROPERTY_CITY_INFO.NAME' => 'Москва'];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question