AEM 6.5.11 AMS || All the Image tags always renders loading=lazy in the html even though we are not using image core component | Community
Skip to main content
June 3, 2023
Solved

AEM 6.5.11 AMS || All the Image tags always renders loading=lazy in the html even though we are not using image core component

  • June 3, 2023
  • 2 replies
  • 818 views

Hello,

 

All the Image tags always renders loading=lazy attribute in the html even though we are not using image core component.

 

Note: I have not used AEM core components nor hard coded the attribute in the html.

 

We are using dynamic media for image renditions.

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 B_Sravan

@shatarig ,

I tried replicating it, I couldn't see the lazy attribute to my image tags.
Just in case, see if your component has a super resource type.

can you give us an example of your code snippet?

Luckily, in the latest image component (V3) verison, Adobe added an option to disable lazy loading.

2 replies

Jagadeesh_Prakash
Community Advisor
Community Advisor
June 3, 2023

@shatarig 

By default, AEM does not add the loading="Lazy" attribute to image tags. The loading="Lazy" attribute needs to be explicitly added to the image tags in the HTML code.

 

  1. Edit the component's dialog or template: If you have access to the component's dialog or template, review the HTML code to see if the loading="Lazy" attribute is being added there. Look for any custom logic or scripts that might be automatically adding this attribute.

  2. Check the AEM configuration: AEM provides various configuration options that can affect the rendering of HTML. Look for any specific configurations related to image handling or lazy loading in your AEM instance.

  3. Custom code or scripts: If you have any custom code or scripts running on your AEM instance, they could be responsible for adding the loading="Lazy" attribute to image tags. Review your custom codebase for any logic related to image handling or lazy loading. 

B_Sravan
Community Advisor
B_SravanCommunity AdvisorAccepted solution
Community Advisor
June 3, 2023

@shatarig ,

I tried replicating it, I couldn't see the lazy attribute to my image tags.
Just in case, see if your component has a super resource type.

can you give us an example of your code snippet?

Luckily, in the latest image component (V3) verison, Adobe added an option to disable lazy loading.

Jagadeesh_Prakash
Community Advisor
Community Advisor
June 5, 2023

I agree with @b_sravan  even i tried in my local and unable to replicate the issue. If should be loading from your custom code @shatarig