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.
SantoshSai
SantoshSaiAccepted solution
New Participant
Dec 19, 2022 11:47 PM UTC

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

4 replies

Monendra_Singh
Level 3
Dec 25, 2022 10:50 PM UTC

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.

Translate
SantoshSai
SantoshSaiAccepted solution
New Participant
Dec 19, 2022 11:47 PM UTC

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

Translate
Santosh Sai
Mani_kumar_
New Participant
Dec 19, 2022 2:38 PM UTC

Could please elaborate the problem here ?

Translate
vinuu123Author
Level 3
Dec 20, 2022 6:15 AM UTC

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

Translate