In Drupal 8 if I want to stop images from printing width and height details I would add this to my mytheme.theme file:

function dumdumtheme_preprocess_image(&$variables) {

if (isset($variables['attributes']['width']) && isset($variables['attributes']['height'])) {

unset($variables['attributes']['width']);

unset($variables['attributes']['height']);

}

}

In my Backdrop theme/mytheme directory I have tried adding a file: themesettings.php and including the above code in there.

But it does not work (width and height code is still being generated in the HTML output).

Where or how would I achieve this in Backdrop?

 

 

Comments