Answer the question
In order to leave comments, you need to log in
How to write a check if the link is normal or modal?
The site has links. From the admin panel, links like /path/ or /img/img.png can be specified.
<?foreach($arResult["ITEMS"] as $arItem):?>
<?if($arItem["PROPERTIES"]["LINK"]["VALUE"]):?>
<div class="js-category">
<a href="<?=$arItem["PROPERTIES"]["LINK"]["VALUE"]?>" class="category-products" style="background-image: url('<?=$arItem["PREVIEW_PICTURE"]["SRC"]?>');">
<h6><?=$arItem["NAME"]?></h6>
</a>
</div>
<?endif;?>
<?endforeach;?>
$('.js-category').magnificPopup({
delegate: 'a',
type: 'image'
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question