How to display images on specific domains only?

How to display images on specific domains only?

Jesper_Skaane_B
Excursionist
27 0 4

Greetings!

I have an image on my cart page:

hide.PNGWhich i only want to display, when people visit the Danish version of my site (www.ydale.dk)
I have multiple domains for each market (so swedish would be www.ydale.se)

Is this possible?

I am thinking something in the lines of a IF construct. but i am not very good at coding.

So:

If domain is (or starts with) www.ydale.dk then show image else *nothing/hide*

Is this possible?

Thanks in advance

Reply 1 (1)

Jesper_Skaane_B
Excursionist
27 0 4

I thought this would work, but it doesnt 😞

{% if (str_contains($url, "ydale.dk")) %}
<img src="https://cdn.shopify.com/s/files/1/2274/5315/t/11/assets/SST_Alkohol_2.jpg
" alt="Vi sælger kun alkohol til personer over 18">
{% else %}

{% endif %}