Gabriel Torres Posted July 25, 2023 Posted July 25, 2023 Hi, The thumbImage template has two small issues IMHO that should be addressed. {{if $image}} {{$image = ( $image instanceof \IPS\File ) ? (string) $image->url : $image;}} {{if $url}}<a {{if $dataParam}}{$dataParam} {{endif}}href='{$url}' title='{lang="$lang" sprintf="$name"}'{{else}}<span{{endif}} {{if !$lazyLoad || !settings.lazy_load_enabled}}style='background-image: url( "{file="$image" extension="$extension"}" )'{{else}}data-background-src='{file="$image" extension="$extension"}'{{endif}} class='{$classes} ipsThumb ipsThumb_{$size} ipsThumb_bg'> <img {{if $lazyLoad && settings.lazy_load_enabled}}src='{expression="\IPS\Text\Parser::blankImage()"}' data-{{endif}}src='{file="$image" extension="$extension"}' alt=''> {{if $url}}</a>{{else}}</span>{{endif}} {{else}} {{if $url}}<a {{if $dataParam}}{$dataParam} {{endif}}href='{$url}' title='{lang="$lang" sprintf="$name"}'{{else}}<span{{endif}} class='{$classes} ipsNoThumb ipsThumb ipsThumb_{$size}'>{{if $url}}</a>{{else}}</span>{{endif}} {{endif}} 1. The lazy loading scheme used is outdated, as it could simply use the loading="lazy" parameter, as it has been updated in other templates. 2. The alt='' should be replaced with alt='{lang="$lang" sprintf="$name"}' Cheers! SeNioR- 1
Marc Posted July 26, 2023 Posted July 26, 2023 Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release.
SeNioR- Posted July 26, 2023 Posted July 26, 2023 On 7/25/2023 at 8:56 PM, Gabriel Torres said: settings.lazy_load_enabled}}src='{expression="\IPS\Text\Parser::blankImage() Agree. This is an obsolete method and should not be used anymore.
Stuart Silvester Posted July 26, 2023 Posted July 26, 2023 Yes and no, loading="lazy" cannot work for background-images for example, which is something we use it for currently. We won't be making any changes for this in v4. SeNioR- 1
Solution Marc Posted January 24 Solution Posted January 24 This issue has been resolved in the recently released 4.7.15 version. Please update your site if you are still experiencing the issue, and let us know if you see any reoccurrence. Gabriel Torres and SeNioR- 1 1
Recommended Posts