Answer the question
In order to leave comments, you need to log in
Bitrix how to display a list of news, excluding the current one?
Site on bitrix. A list of all news is also displayed on the page of a separate news item. How to exclude the current news from this list?
Answer the question
In order to leave comments, you need to log in
Add a filter to the call code of the news component excluding the current news
<?$GLOBALS['press_filter'] = array('!ID'=>$arResult['ID']);?>
$APPLICATION->IncludeComponent(
"bitrix:news.list",
"",
array(
"FILTER_NAME" => "press_filter",
In detail.php, there are no entry id parameters in the $arResult array. Alternatively, use a symbolic code.
$GLOBALS['arrFilter'] = array('!CODE' => $arResult['VARIABLES']['ELEMENT_CODE'];
Unfortunately, also to no avail. Posted in detail.php https://yadi.sk/i/uGlYnN0a0Wbu3w
the filter names are the same, the filter itself is enabled. It seems like a standard task, but I don’t understand how to do it)))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question