Hello Team,
In AEM Cloud, I want to display a default image on my page when any asset has expired.
I know that the DAM expiry job unpublishes the asset from the publish instance. I tried to write a filter, but it did not fulfill my requirement.
Please let me know if there is any way to meet my requirement.
Thank you in advance.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Kamaraj_AEM
One way for implementing a default or fallback image in AEM using a Sling Model, you can write custom logic in the model to check if an image resource is present. If the image is missing, the model can then refer to a predefined default image resource as a fallback.
@arunpatidar thanks for your reply.
Most of the assets are used in content fragments and exposed to third parties using Graphql URL.
So I am looking for a common solution both pages and content fragments.
Thanks!
Views
Replies
Total Likes
HI @Kamaraj_AEM
Maybe you can set default image at config level which you might be exposing via GraphgQL , if not then you need to extend graphQL response to add another field.
Views
Replies
Total Likes
I didn't understand your point. Can you please explain in a bit more depth with an example?
Views
Replies
Total Likes
Hi @Kamaraj_AEM
Please check below - https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/extend-graphql-content-fra...
Views
Replies
Total Likes
Hi @Kamaraj_AEM ,
We can use onerror attributes. The onerror event is triggered if an error occurs while loading an external file (e.g. a document or an image).
<img src="foo.jpg" onerror="this.src='fallback/image.jpg';this.onerror='';">
Thanks
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies