P
P
papabig2018-05-08 15:47:06
1C-Bitrix
papabig, 2018-05-08 15:47:06

How to display elements with a specific infoblock property?

There is an infoblock and a custom property that adds a checkbox to the element's properties.
There are elements where the checkbox is checked, and there are elements where the checkbox is empty.
You need to display elements on the page only with a checkmark.
At the moment, I have displayed all the elements through news: list, but how to filter?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasya, 2018-05-08
@papabig

The FILTER_NAME parameter for the component.
Those. if the checkbox is made via the list type.
global $arrNewsFilter = ["PROPERTY_CHECKBOXCODE" => "list value ID"];
$APPLICATION->IncludeComponent(array(
....
"FILTER_NAME" => "arrNewsFilter",
...

D
DM, 2020-03-13
@neverenn

Before outputting a component:

<?$GLOBALS["FilterPopulars"] = array("PROPERTY_ATT_POPULAR_VALUE"=>"Да");?>

In the component code, add/fill in the line FilterPopulars - filter name PROPERTY_ATT_POPULAR_VALUE - ATT_POPULAR - property name "Yes" - the option that is set in the infoblock property settings
"FILTER_NAME" => "FilterPopulars",

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question