M
M
Maxim_Sokolov2015-10-20 10:06:43
1C-Bitrix
Maxim_Sokolov, 2015-10-20 10:06:43

How to display the property of a component in the list of products (1C Bitrix)?

Good afternoon. The problem is this: there is a component that displays a list of product lines. For this component, I created a property of type "text/html". And the property is not displayed on the list page. Moreover, everything is fine on the detailed page. The code that displays this property is -

<?foreach($arResult["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?> 

<?=$arProperty["NAME"]?>: 
<?if(is_array($arProperty["DISPLAY_VALUE"])):?> 
<?=implode(" / ", $arProperty["DISPLAY_VALUE"]);?> 
<?else:?> 
<?=$arProperty["DISPLAY_VALUE"];?> 
<?endif?> 
<br /> 
<?endforeach;?>

Question: Why is the property displayed only on the detail page, but not on the list page?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Ivchenko, 2015-10-20
@Serg89

As far as I remember, the list of pages has a different construction of the properties of the elements. there is something like$arItem['PROPERTIES']['DISPLAY_VALUE']['VALUE']

S
Sergey, 2015-10-20
@gangstarcj

Did you specify it in the component settings so that it is displayed? There is such Properties for the list of materials, properties for the detailed page.
Second, they are not stored in arResult, but in arItem. arResult stores a list of the materials themselves
$arItem["DISPLAY_PROPERTIES"]
More properties can be found in $arItem["PROPERTIES"]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question