Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
Hi,
I’ve recently purchased a new theme and want to add different accordion information for different products. I’ve assigned different meta fields for each product but they still don’t show the correct pages. Previously I’ve worked around this issue by creating individual product templates but I can’t do that for this theme as it causes the header to bug and appear twice.
Hi Byanymeans,
To display different content on different products using the same Liquid template, you should look into using metafields. Showing unique values for accordions is a common use-case for metafields. What you'd essentially do is create new metafield properties for your products, and in the admin product pages, you'd populate these metafields with the unique values. Then on the theme editor you can navigate to the text inputs for the accordian and add in what we call dynamic sources that display the unique values on each product page.
I'd recommend checking out the links above and also this video to see how to use metafields for your use case.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi Liam,
Thanks for your reply. I feel as though I’ve already followed your advice step by step and still my accordions won’t display unique values for different products, they’ll only update to the most recent linked dynamic source.
Yes, I am having the same problem. It's very frustrating.