Closed Metis77 closed 3 years ago
First of all the Picture
class is deprecated - do not use it anymore in your code. (If we're at it you should also stop using the globally namespaced class aliases instead of their 'real' location under the Contao
namespace.)
The code in question simply does not handle meta data or additional attributes. For Contao 4.10 and up, you can use the image studio component. For older versions you might want to fiddle with Controller::addImageToTemplate()
.
tested in Contao 4.9
if I include images like that (for example in a newslist template) the lazyload attribute from the
imgSizes
is ignored. Also the alt attribute stays empty.If working with
$this->insert('image', $this->arrData);
the lazyload attribute is present. But this way, the image is wrapped in the newsreader reader link.