Answer the question
In order to leave comments, you need to log in
How to display the properties of an element in the news list?
Hello,
There is Bitrix and the bitrix:news.list module.
Please tell me how to display the properties of an element in the bitrix:news.list module separately from each other (output through foreach is not suitable).
I found the only solution - note.dimexio.ru/?p=748 , but I can't use it because I don't have enough brain.
Answer the question
In order to leave comments, you need to log in
Dirty way but fast: if you need to display strongly from each other - create a forich in the place where you need, select all properties and check for the property name display data on it.
I am writing a guide for myself.
Output of the element property in the bitrix:news.list module separately from each other.
Output of one property:
<?foreach($arItem["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?>
<?if($arProperty["CODE"]=="PROPERTYCODE"):?>
<?=$arProperty["DISPLAY_VALUE"];?>,
<?endif;?>
<?endforeach;?>
<?foreach($arItem["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?>
<?if($arProperty["CODE"]=="PROPERTYFIRST" && is_array($arItem["DISPLAY_PROPERTIES"]["PROPERTYFIRST"])):?>
<?=$arProperty["DISPLAY_VALUE"];?>
<?elseif($arProperty["CODE"]=="PROPERTYSCND"):?>
<?if(!is_array($arItem["DISPLAY_PROPERTIES"]["PROPERTYFIRST"])):?>
<?=$arProperty["DISPLAY_VALUE"];?>
<?endif;?>
<?endif;?>
<?endforeach;?>
<?foreach($arItem["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?>
<?if($arProperty["CODE"]=="PROPERTYSCND"):?>
<?if(!is_array($arItem["DISPLAY_PROPERTIES"]["PROPERTYFIRST"])):?>
<?=$arProperty["DISPLAY_VALUE"];?>
<?endif;?>
<?endif;?>
<?endforeach;?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question