Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

handle scenario if it is not authored thumbnail in AEM

Avatar

Level 3
 
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @vinuu123 ,

I think you might be talking about page property Thumbnail? Assuming that you have to check the custom implemented code where fetching the thumbnail and have added if else condition - should be in HTL. If thumbnail image has been configured render it, otherwise your required expectation implementation goes there. If it's not the page property even in that case above code approach should work.

Hope that helps!

Regards,

Santosh

View solution in original post

4 Replies

Avatar

Level 3

for particular pages, if thumbnail is not present we can add in page properties. but here the scenario is, if thumbnail is not present for already existing pages, how to handle the issue if it is not through authoring for multiple pages

Avatar

Correct answer by
Community Advisor

Hi @vinuu123 ,

I think you might be talking about page property Thumbnail? Assuming that you have to check the custom implemented code where fetching the thumbnail and have added if else condition - should be in HTL. If thumbnail image has been configured render it, otherwise your required expectation implementation goes there. If it's not the page property even in that case above code approach should work.

Hope that helps!

Regards,

Santosh

Avatar

Level 4

If you want to add thumbnails to pages in Adobe Experience Manager (AEM) where the thumbnail is not present and you want to do this for multiple pages at once, you can use the AEM Asset API and a script to automate the process. Here is one way you can do this:

  1. Write a script that uses the Asset API to search for pages without thumbnails. You can use the query method of the AssetManager class to search for assets that meet certain criteria, such as having a specific property set to a certain value.

  2. Write a script that iterates over the pages returned by the search and adds a thumbnail to each page using the setProperty method of the Asset class. You can use the JcrConstants.JCR_CONTENT_THUMBNAIL property to set the thumbnail for the page.

  3. Run the script to add thumbnails to the pages. You can run the script on your local machine or on a server that has access to the AEM instance.

It is important to note that you will need to have the necessary permissions to use the Asset API and write scripts in order to automate this process.