Код |
---|
<?foreach($arResult["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?> <?if($arProperty['CODE']=="COM_MODS"):?> <?foreach($arProperty['VALUE'] as $value) { $props=CIBlockElement::GetProperty($arProperty['LINK_IBLOCK_ID'], $value,"sort", "asc", Array("CODE"=>"MOD_IMG")); $pic_id=$props->fetch(); $pic=CFile::GetFileArray($pic_id['VALUE']); echo'<img src="'.$pic['SRC'].'">'; echo $arProperty["DISPLAY_VALUE"]; }?> <?endif?> <?endforeach?> |
Код |
---|
$arFilter = Array("IBLOCK_ID"=>$arProperty["LINK_IBLOCK_ID"], ID=>$arResult["PROPERTIES"]["COM_MODS"]["VALUE"]); $arSelect = Array("IBLOCK_ID", "PROPERTY_MOD_IMG") $res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect); while($ob = $res->GetNext(false,false)) $arResult["MOD_IMG"][] = CFile::GetPath($ob["PROPERTY_MOD_IMG_VALUE"]); |