N
N
ne_pes2019-11-10 22:36:11
1C-Bitrix
ne_pes, 2019-11-10 22:36:11

Why are links in the Bitrix template set from the site root?

I want to pass a link to the template through a property, but the link starts from the root of the site. How to fix it?

<div class="banner-slide__title bannerText"><a href="<?=$arItem["DISPLAY_PROPERTIES"]["SLIDER_URL"]["VALUE"] ?>"><?=$arItem["NAME"]?></a></div>

I pass the value yandex.ru, and the link becomes: http:/site.ru/yandex.ru

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Bro, 2019-11-10
@ne_pes

I pass the value yandex.ru, and the link becomes: http:/site.ru/yandex.ru

If you want to get a link to Yandex, then try passing the value with the protocol:
http://yandex.ru

A
Alexander, 2019-11-10
Madzhugin @Suntechnic

Bitrix has nothing to do with it. What you enter into a property is what it outputs.
Those. let's say if you entered yandex.ru, then href will just be yandex.ru. and of course this will be a link to http:/site.ru/yandex.ru with the main one.
htmlbook.ru/samhtml/ssylki/absolyutnye-i-otnositel...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question