Product page unique accordion content

byanymeans
Excursionist
21 0 4

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.

Replies 2 (2)

Liam
Shopify Staff
2689 289 738

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

byanymeans
Excursionist
21 0 4

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.