πŸ‘€ See Sanity in action: Watch product demo now β†’

the Problem is when I add the Objects "location" and "exif" to the PortableText, than they will not be applied. I don't get the "Metadata" with the image.

7 replies
Last updated: Nov 2, 2020
Hello,I have a maybe small question.

I have added metadata to images like here. It works (
https://www.sanity.io/help/asset-metadata-field-invalid )But the Problem is when I add the Objects "location" and "exif" to the PortableText, than they will not be applied.
I dont get the "Metadata" with the image.

I'm using the standard Gridsome Sanity Blog Starter Template

{

type: 'mainImage',

options: {hotspot: true, metadata: ['location', 'palette', 'exif']  },


}
Nov 2, 2020, 1:17 PM
This would only be applied for new uploaded images, I think.
Have you tried uploading a new one and see if that gets the metadata?
Nov 2, 2020, 1:24 PM
This would only be applied for new uploaded images, I think.
Have you tried uploading a new one and see if that gets the metadata?
Nov 2, 2020, 1:24 PM
Thank you. I tried it. But no luck. The normal "mainImage" gives me metadata. The image in the Content Block not. I searched all Docs and this channel.
Nov 2, 2020, 1:31 PM
Right, so you will have to resolve the reference to get the data from the asset document..You have to use a raw field and
resolveReferences

https://github.com/sanity-io/gridsome-source-sanity#raw-fields
Nov 2, 2020, 1:40 PM
πŸ’― Thank you! This was the missing part. Thank you for your time
Nov 2, 2020, 1:46 PM
Great!
Nov 2, 2020, 1:47 PM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.