Jump to content

Recommended Posts

Posted

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!

Posted

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.

 

Posted
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.

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

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