Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted April 13, 20222 yr Hi, I noticed via GTMetrix/Pagespeed that my Club Icons waaay down the page of my forum are not being deferred/lazy loaded when they could/should be. Forums > Front > Index > forumGridItem (lines 33 and 35) {{if $club}} <img src="{{if $club->profile_photo}}{file="$club->profile_photo" extension="core_Clubs"}{{else}}{resource="default_club.png" app="core" location="global"}{{endif}}" alt='' class='cForumGrid__icon-image'> {{elseif $forum->icon}} <img src="{file="$forum->icon" extension="forums_Icons"}" alt='' class='cForumGrid__icon-image cForumGrid__icon--custom'> {{else}} Fixed by adding the lazy load attributes: {{if $club}} <img src="{{if $club->profile_photo}}{file="$club->profile_photo" extension="core_Clubs"}{{else}}{resource="default_club.png" app="core" location="global"}{{endif}}" alt='' loading="lazy" class='cForumGrid__icon-image'> {{elseif $forum->icon}} <img src="{file="$forum->icon" extension="forums_Icons"}" alt='' loading="lazy" class='cForumGrid__icon-image cForumGrid__icon--custom'> {{else}} and Forums > Front > Index > forumRow (lines 10 and 12) {{if $club}} <img src="{{if $club->profile_photo}}{file="$club->profile_photo" extension="core_Clubs"}{{else}}{resource="default_club.png" app="core" location="global"}{{endif}}" alt='' class='ipsItemStatus ipsItemStatus_large {{if !\IPS\forums\Topic::containerUnread( $forum ) && !$forum->redirect_on}}ipsItemStatus_read{{endif}}'> {{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}}'> {{else}} Fix: {{if $club}} <img src="{{if $club->profile_photo}}{file="$club->profile_photo" extension="core_Clubs"}{{else}}{resource="default_club.png" app="core" location="global"}{{endif}}" alt='' loading="lazy" class='ipsItemStatus ipsItemStatus_large {{if !\IPS\forums\Topic::containerUnread( $forum ) && !$forum->redirect_on}}ipsItemStatus_read{{endif}}'> {{elseif $forum->icon}} <img src="{file="$forum->icon" extension="forums_Icons"}" alt='' loading="lazy" class='ipsItemStatus ipsItemStatus_custom {{if !\IPS\forums\Topic::containerUnread( $forum ) && !$forum->redirect_on}}ipsItemStatus_read{{endif}}'> {{else}} 🙂