Hi,
why is this Pimcore-Example-Code not working?
/ disable the automatically added width & height attributes /
{{ img.thumbnail('sliderLargeTest').html({}, ['width', 'height']) }}
Output is with width and height of image-tag:
<picture >
<source srcset="/_dev/works/works/image-thumb__5960__sliderPreview/external-content.duckduckgo.com7.webp 1x, /_dev/works/works/image-thumb__5960__sliderPreview/external-content.duckduckgo.com7@2x.webp 2x" type="image/webp" />
<source srcset="/_dev/works/works/image-thumb__5960__sliderPreview/external-content.duckduckgo.com7.jpg 1x, /_dev/works/works/image-thumb__5960__sliderPreview/external-content.duckduckgo.com7@2x.jpg 2x" type="image/jpeg" />
<img class="sliderPreviewImage" src="/_dev/works/works/image-thumb__5960__sliderPreview/external-content.duckduckgo.com7.jpg" width="350" height="179" alt="" loading="lazy" />
</picture>
Now I tested all this Versions:
{{ img.thumbnail('sliderLargeTest',{
"disableWidthHeightAttributes":true
}).html({
'imgAttributes': {
'class': 'sliderPreviewImage',
'disableWidthHeightAttributes':true,
'width':0,
'height':0
},
'pictureAttributes': {
"disableWidthHeightAttributes":true
},
"disableWidthHeightAttributes":true,},['width','height'])|raw }}
nothing change - width and height is there.
Hey, I'm currently facing some issues with the getBy methods of my classes.
public function someFunc($status){
$error = DataObject\ErrorMsg:getByCode($status, ['limit' => 1]);
// this does not return a ErrorMsg Object instead it returns a car Object
}
Has someone faced some similar issues?
I'm really struggeling to track down the error