Jump to content

Lazy load in 3rd-party resources


Go to solution Solved by newbie LAC,

Recommended Posts

Hello,

16 hours ago, sobrenome said:

I have changed the template userPhoto to add the lazy loading, but when I insert the <div data-ipsLazyLoad> wrapping the image it breaks the website design. Is it possible to add lazy loading for profile images in the next release? 

You can omit the wrapper

Since 4.4.3 you can use lazy loading without wrapper.

Works only on front end (if defined core.front.core.app controller).

Works anywhere for ajax calls

16 hours ago, sobrenome said:

the template userPhoto

Find 

src='{$member->photo}'

change to

{{if settings.lazy_load_enabled}}src='{expression="\IPS\Text\Parser::blankImage()"}' data-{{endif}}src='{$member->photo}'

 

Link to comment
Share on other sites

37 minutes ago, sobrenome said:

There is a problem in embed content. The profile image does not load:

There is no js on embed page

Use next code

{{if settings.lazy_load_enabled and request.do != 'embed'}}src='{expression="\IPS\Text\Parser::blankImage()"}' data-{{endif}}src='{$member->photo}'

 

Edited by newbie LAC
Link to comment
Share on other sites

  • 9 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...