Validate a URL before a user clicks on it

Highlighted
New Member
2 0 0

When working in liquid files, is there a way to validate a link's href before a user clicks on it (to make sure it doesn't go to a 404 page)? I haven't been able to find anything about this. If there isn't a standard liquid variable I can use then it seems we would need to be able to access all known URLs of the store, yea?

Context: On blog posts, I need to make the author's name linkable to their bio page, but not every author will have a bio page. For those that don't have a bio page, it needs to link elsewhere.

Any ideas or suggestions?

0 Likes
Highlighted
Shopify Partner
318 21 65

You should search this forum, as this was recently spoken to  

 

https://community.shopify.com/c/Shopify-APIs-SDKs/Check-whether-a-URL-exists-or-not/m-p/801359#M5250...

 

0 Likes
Highlighted
New Member
2 0 0

Yea I saw this response. I'll have to keep messing with it. Thanks.

0 Likes