G
G
Good Samaritan2018-06-26 13:55:18
1C-Bitrix
Good Samaritan, 2018-06-26 13:55:18

How to get a custom list type property in news.list?

In the news.list component call, I do this

"PROPERTY_CODE" => array(
      0 => "POPULAR",//свойство типа список
      1 => "ELEMENT_CODE",
      2 => "",
    ),

In the array arResult I get
[POPULAR] => Array
                        (
                            [ID] => 23
                            [TIMESTAMP_X] => 2018-06-26 13:41:43
                            [IBLOCK_ID] => 11
                            [NAME] => Выводить в "Популярные услуги"
                            [ACTIVE] => Y
                            [SORT] => 500
                            [CODE] => POPULAR
                            [DEFAULT_VALUE] => 
                            [PROPERTY_TYPE] => L
                            [ROW_COUNT] => 1
                            [COL_COUNT] => 30
                            [LIST_TYPE] => L
                            [MULTIPLE] => N
                            [XML_ID] => 
                            [FILE_TYPE] => 
                            [MULTIPLE_CNT] => 5
                            [TMP_ID] => 
                            [LINK_IBLOCK_ID] => 0
                            [WITH_DESCRIPTION] => N
                            [SEARCHABLE] => N
                            [FILTRABLE] => N
                            [IS_REQUIRED] => Y
                            [VERSION] => 1
                            [USER_TYPE] => 
                            [USER_TYPE_SETTINGS] => 
                            [HINT] => 
                            [PROPERTY_VALUE_ID] => 
                            [VALUE] => 
                            [DESCRIPTION] => 
                            [VALUE_ENUM] => 
                            [VALUE_XML_ID] => 
                            [VALUE_SORT] => 
                            [VALUE_ENUM_ID] => 
                            [~VALUE] => 
                            [~DESCRIPTION] => 
                            [~NAME] => Выводить в "Популярные услуги"
                            [~DEFAULT_VALUE] => 
                        )

for some reason, the array does not contain the value of the selected list, it is empty and that's it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita, 2018-06-26
@Rema1ns

what's in

$arResult['ITEMS'] .... ['DISPLAY_PROPERTIES']['POPULAR']

?

K
Kudis, 2018-06-26
@kudis

Apparently this element is empty. Then the property will be displayed in the PROPERTIES array exactly as it looks on yours. Otherwise, VALUE will contain its value, and VALUE_XML_ID will contain its key:

[VALUE] => value
[DESCRIPTION] => 
[VALUE_ENUM] => value
[VALUE_XML_ID] => xml_id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question