Z
Z
z_u_l2018-06-14 23:31:54
1C-Bitrix
z_u_l, 2018-06-14 23:31:54

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;?>

I use Magnific Popup
$('.js-category').magnificPopup({
        delegate: 'a',
        type: 'image'
 });

Now links like /path/ are trying to open a window, although I do not need this, I just need to go to the appropriate section of the site. Actually a question. How to write a check if the link is normal or modal?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ice, 2018-06-15
@IceRD

you can hang any other class on the div, depending on what comes in $arItem["PROPERTIES"]["LINK"]["VALUE"]
or get all links / determine by pressing $('a').attr( 'href'); and do something with them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question