My Metafields are not displaying correctly. They are showing raw data

Arun_O
Excursionist
15 0 4

Hey All.

 

My store URL is https://caresmith-india-cd1f.myshopify.com/ I am using Ella theme for shopify and somehow all my metafields are displaying in what I believe is JSON format instead of how they should be displayed. 

They are rich text metafields and this is the output they are giving on the front end. 

{"type":"root","children":[{"listType":"unordered","type":"list","children":[{"type":"list-item","children":[{"type":"text","value":"Item 1"}]},{"type":"list-item","children":[{"type":"text","value":"Item 2"}]},{"type":"list-item","children":[{"type":"text","value":"Item 3"}]}]}]}

On the product page in the metafield editor it shows perfectly fine as 

  • Item 1
  • Item 2
  • Item 3

but on the product page on the front end it shows that unformatted metafield code

 

Would appreciate any help

Replies 7 (7)

JHKCreate
Shopify Expert
3571 639 914

Add .value at the end of your metafield variable. Let us know if that does it!

Did we solve your issue? Like & Mark As Solution to help the community
Should you need any direct help: contact@jhkcreate.com

Learn more about us: jhkcreate.com
Arun_O
Excursionist
15 0 4

At the end of the variable name? or in the product-tab.liquid where the metafield is referenced?

Arun_O
Excursionist
15 0 4

Here's the liquid for the metafield tab

			{%- liquid
				assign title = block.settings.title
				assign has_tab = false
				assign source = block.settings.product_custom_source
				assign key = block.settings.product_tab_key_metafield

				if source == 'dynamic'
                   assign meta_ref = key
                else 
                   assign meta_ref = product.metafields.c_f[key]
                endif 
                
				if block.type == 'custom'
					if block.settings.type == 'metafield'
						if meta_ref
			                assign has_tab = true
			                assign content = meta_ref
			            else
			            	assign has_tab = false
			            endif
			        else
			        	assign has_tab = true
			        	assign content = block.settings.content
			        endif
				else
					assign has_tab = true
					if block.type == 'description'
						assign content = product.description
					else block.type == 'review'
						assign content = product.metafields.spr.reviews
					endif
				endif

				if block.type == 'description' or block.type == 'review' or block.type == 'custom'
					assign style_mobile = false
					if block.settings.open_tab_mobile
						assign style_mobile = 'show-mobile'
					endif
					if tab_layout_mobile == 'popup'
						assign style_mobile = 'popup-mobile'
					endif
				endif
			-%}

Arun_O
Excursionist
15 0 4

Still looking for a solution for this. Would appreciate any help

Arun_O
Excursionist
15 0 4

Bumping for visibility

Hunter11
New Member
4 0 0

Did you ever solve this issue? I am facing the same problem.

 

AsadBaig
Shopify Partner
43 1 2

Hi @Hunter11 
Please Share your store url, and meta fields data

Get your e-commerce solutions
If you have any queries get in touch:
Email: baigasadullah4@gmail.com
Linkedin: https://www.linkedin.com/in/shopifystore-development-customization/