How to use IMG SRCSET and SIZES instead of PICTURE for Responsive Images
Permalink
I need to override C5.7’s default behaviour for embedding responsive images. I want to use the IMG tag with the new SCRSET and SIZES attributes, instead of the PICTURE tag.
I assumed that I could do this by creating a custom template for the image block but it appears it’s not that simple.I have tried following the info on this Docs page:
http://documentation.concrete5.org/developers/designing-for-concret...
I am having trouble finding the core files that create the image class:
Which core file is this in?
Any advice as to how I could create the override (without hacking the core) would be much appreciated.
I assumed that I could do this by creating a custom template for the image block but it appears it’s not that simple.I have tried following the info on this Docs page:
http://documentation.concrete5.org/developers/designing-for-concret...
I am having trouble finding the core files that create the image class:
\Concrete\Core\Html\Image
Which core file is this in?
Any advice as to how I could create the override (without hacking the core) would be much appreciated.
\Concrete\Core\Html\Image
means your file is located in
concrete\src\Html\Image.phpIf you find code, which you want to replace, then tommorow I will write how to override it (unless someon will reply about it earlier).
Maybe check also:
concrete\src\Html\Object\Picture.php
why dont you use a javscript to give you img size based on screen. and link that to your added css classes?