MODX Community

msGalery and json-ld

I’m trying to add in json-ld the image property of my product.
in tpl_product_details exist the [[msGallery]] that i believe somehow i have to use.
in general something like that:

[ { "@context" : "", "@type" : "Product", "name" : "[[*pagetitle]]", "image" : "[[*msGallery]]",... but you know this is not the correct way since msGallery snippet is not ppointing to the exact image file. Could you please explain me how to point the correct image file inside json-ld? Thanks in Advance

Hi @pakosfakos
If you use minishop2 your product page should have thumb placeholder, if so - you could use next for json-ld instead:

 <script type="application/ld+json">
          "image": "[[++site_url]][[*thumb]]"
1 Like

you save my life man, yes this is the solution. Thanks a lot!

you’re welcome :love_you_gesture: