Metafield URL values incorrect when called in HTML block using liquid (relative instead of absolute)

Hello everyone!

We’ve added URL metafields to our product page (https://rotor.one/products/melbourne-city-scenic) to link out to related products and pages.

We’re using an IF statement to render some simple HTML and call the metafield URL using liquid.

More than 3 people? }}">Book a Group Tour

{% endif %}> ```

The metafield namespace and key is:

product.metafields.custom.group_booking_url

The metafield URL definition we’ve defined for this product is:

https://rotor.one/pages/helicopter-proposal-packages

When I check the product page, the HTML is rendering perfectly, however the URL has a prefix attached that is relative to the product page.

Interestingly, when I access the same product through the collection page, the metafield URL has a different prefix relative to the collection page:

Can anyone help me understand how I can force the absolute metafield URL definition to be used, without Shopify adding these prefixes and breaking the links?

Hi @edtau

You can try to add the attribute “target=”_blank"" to the tag like the following example to solve the problem.

Book a Group Tour

I hope that it will work for you.