How do store html code snippets in metafields and populate theme on the theme front end?

How do store html code snippets in metafields and populate theme on the theme front end?

1GMedia
Shopify Partner
6 0 1

How do store html code snippets in metafields and populate theme on the theme front end? I have many I frame embeds, but each one is unique per product. I want to store the embed in the metafields. 

My only work around solution at the moment is adding the different embed code in the product description in html format.

Does anyone have any ideas as to accomplish 


1GMedia Shopify Design Subscription to scale your e-commerce business.
Replies 3 (3)

NomtechSolution
Astronaut
1245 113 159

To store HTML code snippets in metafields and populate them on the theme frontend, you can follow these steps:

  1. Install a Metafields Editor App: Install a Metafields Editor app from the Shopify App Store. There are several apps available that allow you to manage and edit metafields for your products.

  2. Create Metafields: In the Metafields Editor app, create a new metafield for your products. Define the metafield's namespace, key, and value. The key can be something like "embed_code" and the value should be the HTML embed code snippet you want to store.

  3. Assign Metafields to Products: Assign the created metafields to the respective products. This can usually be done through the Metafields Editor app's interface. You can associate the metafields with individual products or use bulk editing options to assign them to multiple products.

Cedcommerce
Shopify Partner
718 77 116

Hello  @1GMedia

 

For your information, Shopify Metafields currently does not support HTML code types to store data. You can store data in the form of text, images, products, files, etc. Although, this may be achieved with a third-party Metafields editor app. 

 

Let us know if you need more help with your Shopify store.

 

Regards, 

CedCommerce

CedCommerce || Shopify Expert
- Let us know if our reply is helpful for you. Like it.
- Was your question answered? Mark it as an accepted solution.
- For further discussion contact: Email ID- apps@cedcommerce.com
- Whatsapp:- Join Here

MRamzan
Shopify Partner
463 3 45

You can put html code in metafield and display it.

 

Hire Me:

WhatsApp: +91-9145985880
Email: mohdramzaan112@gmail.com
Skype: mohdramzaan112