if( is_single() ){ // записи
global $post;
$separator = ' ➺ ';
$categories = get_the_category( $post->ID );
echo get_category_parents($categories->cat_ID, false, $separator);
the_title();
}
$arDiscounts = CCatalogDiscount::GetDiscountByProduct( $arResult["ID"], $USER->GetUserGroupArray(), "N", $min_price_id, SITE_ID );
$arDiscount=array();
if($arDiscounts)
$arDiscount=current($arDiscounts);
if($arDiscount["ACTIVE_TO"]){?>
<div class="view_sale_block" id="out" style="clear: both;">
<div class="count_d_block">
<span class="active_to_<?=$arResult["ID"]?> hidden"><?=$arDiscount["ACTIVE_TO"];?></span>
<div class="title"><?=GetMessage("UNTIL_AKC");?></div>
<span class="countdown countdown_<?=$arResult["ID"]?> values"></span>
<script>
$(document).ready(function(){
if( $('.countdown').size() ){
var active_to = $('.active_to_<?=$arResult["ID"]?>').text(),
date_to = new Date(active_to.replace(/(\d+)\.(\d+)\.(\d+)/, '$3/$2/$1'));
$('.countdown_<?=$arResult["ID"]?>').countdown({until: date_to, format: 'dHMS', padZeroes: true, layout: '{d<}<span class="days item">{dnn}<div class="text">{dl}</div></span>{d>} <span class="hours item">{hnn}<div class="text">{hl}</div></span> <span class="minutes item">{mnn}<div class="text">{ml}</div></span> <span class="sec item">{snn}<div class="text">{sl}</div></span>'}, $.countdown.regionalOptions['ru']);
}
})
</script>
</div>
<div class="quantity_block">
<div class="title"><?=GetMessage("TITLE_QUANTITY_BLOCK");?></div>
<div class="values">
<span class="item">
<span class="value" <?=( count( $arResult["OFFERS"] ) > 0 ? 'style="opacity:0;"' : '')?>><?=$totalCount;?></span>
<span class="text"><?=GetMessage("TITLE_QUANTITY");?></span>
</span>
</div>
</div>
</div>
<?}?>
$arSelect = Array("ID", "IBLOCK_ID", "NAME","PROPERTY_KOLLEKTSIYA");
$arFilter = Array("IBLOCK_ID"=>$arParams['IBLOCK_ID'], "ACTIVE"=>"Y", "PROPERTY_KOLLEKTSIYA"=>$arResult['DISPLAY_PROPERTIES']['KOLLEKTSIYA']['VALUE']);
$res = CIBlockElement::GetList(Array("SORT"=>"ASC"), $arFilter, false, false, $arSelect);
while($ar_fields = $res->Fetch())
{
echo "<pre>" .print_r($ar_fields['NAME'],1)."</pre>";
}
Array
(
[ID] => 211
[IBLOCK_ID] => 23
[NAME] => Коллекция
[ACTIVE] => Y
[SORT] => 10
[CODE] => KOLLEKTSIYA
[DEFAULT_VALUE] =>
[PROPERTY_TYPE] => S
[ROW_COUNT] => 1
[COL_COUNT] => 30
[LIST_TYPE] => L
[MULTIPLE] => N
[XML_ID] => a8b22c8c-acdc-11e7-9867-1c1b0da27397
[FILE_TYPE] =>
[MULTIPLE_CNT] => 5
[LINK_IBLOCK_ID] => 0
[WITH_DESCRIPTION] => N
[SEARCHABLE] => N
[FILTRABLE] => N
[IS_REQUIRED] => N
[VERSION] => 1
[USER_TYPE] => directory
[USER_TYPE_SETTINGS] => Array
(
[size] => 1
[width] => 0
[group] => N
[multiple] => N
[TABLE_NAME] => b_kollektsiya
)
[HINT] =>
[~NAME] => Коллекция
[~DEFAULT_VALUE] =>
[VALUE_ENUM] =>
[VALUE_XML_ID] =>
[VALUE_SORT] =>
[VALUE] => 6e2c973e-ad71-11e7-9867-1c1b0da27397
[PROPERTY_VALUE_ID] => 4556390
[DESCRIPTION] =>
[~VALUE] => 6e2c973e-ad71-11e7-9867-1c1b0da27397
[~DESCRIPTION] =>
[DISPLAY_VALUE] => Тестовая коллекция
)
<? foreach ($arResult["ITEMS"] as $arItem): ?>
<?
$this->AddEditAction($arItem['ID'], $arItem['EDIT_LINK'], CIBlock::GetArrayByID($arItem["IBLOCK_ID"], "ELEMENT_EDIT"));
$this->AddDeleteAction($arItem['ID'], $arItem['DELETE_LINK'], CIBlock::GetArrayByID($arItem["IBLOCK_ID"], "ELEMENT_DELETE"), array("CONFIRM" => GetMessage('CT_BNL_ELEMENT_DELETE_CONFIRM')));
?>
<div class="col-md-4">
<div class="article_card">
<div class="block__all">
<div class="block__img">
<? if ($arParams["DISPLAY_PICTURE"] != "N" && is_array($arItem["PREVIEW_PICTURE"])): ?>
<? if (!$arParams["HIDE_LINK_WHEN_NO_DETAIL"] || ($arItem["DETAIL_TEXT"] && $arResult["USER_HAVE_ACCESS"])): ?>
<div class="height__img">
<a href="<?= $arItem["DETAIL_PAGE_URL"] ?>">
<img class="img-responsive cover" src="<?= $arItem["PREVIEW_PICTURE"]["SRC"] ?>"
alt="<?= $arItem["PREVIEW_PICTURE"]["ALT"] ?>"
title="<?= $arItem["PREVIEW_PICTURE"]["TITLE"] ?>"/>
</a>
</div>
<? else: ?>
<div class="height__img">
<a href="<?= $arItem["DETAIL_PAGE_URL"] ?>">
<img class="img-responsive cover" src="<?= $arItem["PREVIEW_PICTURE"]["SRC"] ?>"
alt="<?= $arItem["PREVIEW_PICTURE"]["ALT"] ?>"
title="<?= $arItem["PREVIEW_PICTURE"]["TITLE"] ?>"/>
</a>
</div>
<? endif; ?>
<? endif ?>
<a href="<?= $arItem["DETAIL_PAGE_URL"] ?>">
<div class="block__text">
<div class="text">
<p>Читать</p>
</div>
</div>
</a>
</div>
</div>
</div>
<div class="article_card-title">
<? if ($arParams["DISPLAY_DATE"] != "N" && $arItem["DISPLAY_ACTIVE_FROM"]): ?>
<span class="news-date-time"><? echo $arItem["DISPLAY_ACTIVE_FROM"] ?></span>
<? endif ?>
<? if ($arParams["DISPLAY_NAME"] != "N" && $arItem["NAME"]): ?>
<? if (!$arParams["HIDE_LINK_WHEN_NO_DETAIL"] || ($arItem["DETAIL_TEXT"] && $arResult["USER_HAVE_ACCESS"])): ?>
<a href="<? echo $arItem["DETAIL_PAGE_URL"] ?>"><b><? echo $arItem["NAME"] ?></b></a><br/>
<? else: ?>
<b><? echo $arItem["NAME"] ?></b><br/>
<? endif; ?>
<? endif; ?>
</div>
</div>
<? endforeach; ?>
.height__img
{
height: 300px;
}
.cover
{
width: 100%;
height: 100%;
object-fit: cover;
}
.cover__fit
{
width: 100%;
height: 100%;
object-fit: cover;
}
.block__img {
overflow: hidden;
background: #000;
cursor: pointer;
}
.block__img img {
width: 100%;
transition: .5s;
}
.block__all:hover .block__img img {
opacity: .5;
}
.block__text {
position: absolute;
top: 30px;
left: 30px;
right: 30px;
bottom: 30px;
}
.text {
color: #fff;
text-transform: uppercase;
/*padding: 0 20px;*/
opacity: 0;
transition: .5s;
position: absolute;
top: 45%;
left: 40%;
}
.block__all:hover .text {
opacity: 1;
}
.block__text::before,
.block__text::after{
content: '';
position: absolute;
top: 40%;
left: 25%;
width: 50%;
height: 20%;
transition: .5s;
}
.block__text::before {
border-top: 1px solid #fff;
border-bottom: 1px solid #fff;
transform: scale(0,1);
}
.block__text::after {
border-left: 1px solid #fff;
border-right: 1px solid #fff;
transform: scale(1,0);
}
.block__all:hover .block__text::before,
.block__all:hover .block__text::after{
transform: scale(1,1);
}
<img class="img-responsive cover" src="<?= $arItem["PREVIEW_PICTURE"]["SRC"] ?>" alt="<?= $arItem["PREVIEW_PICTURE"]["ALT"] ?>" title="<?= $arItem["PREVIEW_PICTURE"]["TITLE"] ?>"/>
.cover
{
width: 100%;
height: 100%;
object-fit: cover;
}