Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
We need to adjust our theme's product template to include the product title at the end of a button's URL. The button links out to an external form and we want to pass the product title into the form, and have that product title change based on which product detail page the customer is on.
I've tried adding product.title to the end of the URL, inside the quotes (following the format I see in other places in the template where product info is referenced), but get the error:
Code example is below from our product json template:
"db3e4b3f-a90f-4e06-96c2-247072ce9d75": {
"type": "button",
"settings": {
"text": "Learn More",
"url": "https:\/\/forms.zohopublic.com\/ourcompany\/form\/InquiryForm\/formperma\/_131?topic={{ product.title }}",
"btn_style": "solid",
"icon": "none",
}
},
I'm not sure how to add this dynamic URL parameter, any help would be appreciated. Thank you!
Solved! Go to the solution
This is an accepted solution.
You can use theme customise option and use metafield as URL.
This is an accepted solution.
You can use theme customise option and use metafield as URL.
Thanks, I did end up using a metafield solution even though it means more to manage on each product.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025