Expand my Community achievements bar.

SOLVED

Accessing metadata of featured image uploaded to a page in AEM

Avatar

Level 3

Hi,

I have uploaded a featured image on the page's images tab. Is there a way to access the image metadata from JCR (e.g. its height in a custom Sling model exporter)?
I know the image metadata for a DAM asset image is available in JCR but could not find a way to get the same information for an image uploaded as a page image directly.
Attaching some screenshots about the properties.

Thanks and regards,
Peter


Page image uploaded:
page_properties_featured_image.png

 

JCR content for the uploaded image:

uploaded_featured_image.png

 

JCR content for a DAM image:

dam_image.png

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi, 

 

No, the metadata is created on images that are uploaded into the DAM not pages, so there won't be any metadata available on the page's featuredImage. Now, regarding the featuredImage you can either upload your own image, which won't be linked to any existing image in the DAM, but it will add the image itself underneath the cq_featuredImage [1], or you can select an image from the DAM [2]. In the latter scenario, you should be able to grab the "fileReference" property and access the DAM image metadata.

 

If you need the metadata, the best approach is to upload the image first into a DAM folder and then select that image from the Page properties.

 

[1]. No FileReference because I uploaded the image

EstebanBustamante_0-1736275896856.png

 

[2]. FileReference because I used the "pick" option and referenced the image

EstebanBustamante_0-1736275605874.png

 

 

You can check here more about how to grab the "fileReference" property in the backend: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/fetch-featured-image-from-... 

 

Hope this helps



Esteban Bustamante

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi, 

 

No, the metadata is created on images that are uploaded into the DAM not pages, so there won't be any metadata available on the page's featuredImage. Now, regarding the featuredImage you can either upload your own image, which won't be linked to any existing image in the DAM, but it will add the image itself underneath the cq_featuredImage [1], or you can select an image from the DAM [2]. In the latter scenario, you should be able to grab the "fileReference" property and access the DAM image metadata.

 

If you need the metadata, the best approach is to upload the image first into a DAM folder and then select that image from the Page properties.

 

[1]. No FileReference because I uploaded the image

EstebanBustamante_0-1736275896856.png

 

[2]. FileReference because I used the "pick" option and referenced the image

EstebanBustamante_0-1736275605874.png

 

 

You can check here more about how to grab the "fileReference" property in the backend: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/fetch-featured-image-from-... 

 

Hope this helps



Esteban Bustamante