Jump to content

Lazy Loading for Forum Icons


Recommended Posts

At the moment, we can only upload a graphical icon, so I suggest adding lazy loading. This helps the page load faster especially on a mobile device and eliminates the error in PageSpeed Insights

{{elseif $forum->icon}}
<img src="{file="$forum->icon" extension="forums_Icons"}" alt='' class='ipsItemStatus ipsItemStatus_custom {{if !\IPS\forums\Topic::containerUnread( $forum ) && !$forum->redirect_on}}ipsItemStatus_read{{endif}}'>


{{elseif $forum->icon}}
<img src="{file="$forum->icon" extension="forums_Icons"}" alt='Icon' class='ipsItemStatus ipsItemStatus_custom {{if !\IPS\forums\Topic::containerUnread( $forum ) && !$forum->redirect_on}}ipsItemStatus_read{{endif}}' loading='lazy'>
Edited by SeNioR-
Link to comment
Share on other sites

  • Recently Browsing   0 members

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