handle scenario if it is not authored thumbnail in AEM | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SantoshSai

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

3 replies

Mani_kumar_
Community Advisor
Community Advisor
December 19, 2022

Could please elaborate the problem here ?

vinuu123Author
Level 3
December 20, 2022

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

SantoshSai
Community Advisor
SantoshSaiCommunity AdvisorAccepted solution
Community Advisor
December 19, 2022

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

Santosh Sai
Monendra_Singh
Level 3
December 25, 2022

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.