A
A
Alex2016-09-09 18:22:36
1C-Bitrix
Alex, 2016-09-09 18:22:36

Multiple field output news.list?

Good afternoon, according to the manual, a multiple field of the file type is displayed without problems in news.detail
result_modifier.php

<?  
$arResult["MORE_PHOTO"] = array();   
   if(isset($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"]) && is_array($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"]))   
   {   
      foreach($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"] as $FILE)   
      {   
         $FILE = CFile::GetFileArray($FILE);   
         if(is_array($FILE))   
            $arResult["MORE_PHOTO"][]=$FILE;   
      }   
   }   
?>

and template
<?  
// additional photos  
$LINE_ELEMENT_COUNT = 2; // number of elements in a row  
if(count($arResult["MORE_PHOTO"])>0):?>  
    <?foreach($arResult["MORE_PHOTO"] as $PHOTO):?>  
        <? $file = CFile::ResizeImageGet($PHOTO, array('width'=>150, 'height'=>'112'), BX_RESIZE_IMAGE_EXACT, true); ?>  
            <div class="more_photo">  
                <a href="<?=$PHOTO["SRC"]?>" name="more_photo">  
                    <img border="0" src="<?=$file["src"]?>" width="<?=$file["width"]?>" height="<?=$file["height"]?>"   
                        alt="<?=$arResult["NAME"]?>" title="<?=$arResult["NAME"]?>" />  
                </a>  
            </div>  
    <?endforeach?>  
<?endif?>

How to write this for news.list.
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-09-09
@gangstarcj

It is necessary in the component settings to make it selectable, then take it and write it in the sheet template

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question