Цитата |
---|
Dmitry Ban пишет:
Речь идёт о шаблонах компонентов, или у вас код прямо в теле страницы? |
Код |
---|
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?> <div class="catalog-element"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> </table> <?if($arResult["DETAIL_TEXT"]):?> <br /><?=$arResult["DETAIL_TEXT"]?><br /> <?elseif($arResult["PREVIEW_TEXT"]):?> <br /><?=$arResult["PREVIEW_TEXT"]?><br /> <?endif;?> <?if(count($arResult["LINKED_ELEMENTS"])>0):?> <br /><b><?=$arResult["LINKED_ELEMENTS"][0]["IBLOCK_NAME"]?>:</b> <ul> <?foreach($arResult["LINKED_ELEMENTS"] as $arElement):?> <li><a href="<?=$arElement["DETAIL_PAGE_URL"]?>"><?=$arElement["NAME"]?></a></li> <?endforeach;?> </ul> <?endif?> <? // additional photos $LINE_ELEMENT_COUNT = 2; // number of elements in a row if(count($arResult["MORE_PHOTO"])>0):?> <a name="more_photo"></a> <div class="more-photo-images"> <?foreach($arResult["MORE_PHOTO"] as $PHOTO):?> <div class="more-photo-image"><a rel="lightbox[goods]" href="/thumb/996x0xIN/<?=$PHOTO["SRC"]?>"><img border="0" src="/thumb/150x100xCUT/<?=$PHOTO["SRC"]?>" alt="<?=$arResult["NAME"]?>" title="<?=$arResult["NAME"]?>" /></a></div> <?endforeach?></div> <?endif?> </div> |
Код |
---|
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?><?php if ($arResult["PICTURE"]["SRC"]) {?> <table cellpadding="0" cellspacing="0" border="0"> <tr><td> <div class="section-preview"> <img style="width:300px" src="<?=$arResult["PICTURE"]["SRC"]?>" title="<?=$arResult["NAME"]?>" /></div> <?php } else { ?><?php }?> <h1><?=$arResult["NAME"]?></h1> <?=$arResult["DESCRIPTION"]?> </td></tr></table> <div class="catalog-section"> <?if($arParams["DISPLAY_TOP_PAGER"]):?> <?=$arResult["NAV_STRING"]?><br /> <?endif;?> <table cellpadding="0" cellspacing="0" border="0"> <?foreach($arResult["ITEMS"] as $cell=>$arElement):?> <?if($cell%$arParams["LINE_ELEMENT_COUNT"] == 0):?> <tr> <?endif;?> <td valign="top" width="<?=round(100/$arParams["LINE_ELEMENT_COUNT"])?>%"> <table class="product-block" cellpadding="0" cellspacing="2" border="0"> <tr> <?if(is_array($arElement["PREVIEW_PICTURE"])):?> <td valign="top"> <a href="<?=$arElement["DETAIL_PAGE_URL"]?>"><img class="image-border" border="0" src="/thumb/150x150xCUT/<?=$arElement["PREVIEW_PICTURE"]["SRC"]?>" alt="<?=$arElement["NAME"]?>" title="<?=$arElement["NAME"]?>" /></a><br /> </td> <?elseif(is_array($arElement["DETAIL_PICTURE"])):?> <td valign="top"> <a href="<?=$arElement["DETAIL_PAGE_URL"]?>"><img class="image-border" border="0" src="/thumb/150x150xCUT/<?=$arElement["DETAIL_PICTURE"]["SRC"]?>" alt="<?=$arElement["NAME"]?>" title="<?=$arElement["NAME"]?>" /></a><br /> </td> <?endif;?> <td valign="top"> <span class="product-name"><a href="<?=$arElement["DETAIL_PAGE_URL"]?>"><?=$arElement["NAME"]?></a></span><br /> <?foreach($arElement["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?> <?=$arProperty["NAME"]?>: <? & |
Код |
---|
$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; } } |
Цитата |
---|
Dmitry Ban пишет:
В настройках компонента в поле "Свойства" это свойство выбрано? |
Код |
---|
<?foreach($arElement["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?> <? if(is_array($arProperty["DISPLAY_VALUE"])) echo implode(" / ", $arProperty["DISPLAY_VALUE"]); else echo $arProperty["DISPLAY_VALUE"]; ?> <?endforeach;?> |