skip to Main Content

I m trying to make a <a> tag in product page which redirects to other pages, I want to give this url using metafield any idea on how to archive this?

2

Answers


  1. Does this work?

    <a href ="[LINK]" ></a>

    Copy the link you need, and put it instead of [LINK]

    Login or Signup to reply.
  2. The answer is pretty simple. Assuming you have your URL in a metafield, just render the value into the href.

    <a href="{{ someresource.metafields.mylinks.url }}" />
    

    Since you did not specify which resource you speak of, I left it as someresource. If it is pages, the use pages. mylinks is your namespace where you stored your metafield key values. The key is url, and the value is whatever you stored there, a link to another page maybe.

    Shopify has a ton of documentation on using Metafields, you can refer to those for more details.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search