In order to create a responsive website with Typo3 and Twitter Bootstrap, I would like to remove the height and width attributs of images
Here's how images are generated in Frontend via content element of type text & image and image
<img src="typo3temp/pics/a625b79f89.jpg" width="300" height="226" alt="blabla" />
I would like to remove the dimension attributes and get this:
<img src="typo3temp/pics/a625b79f89.jpg" alt="blaba" />
Can anyone help me ?
If your image has an
id
or another unique attribute assigned, you can easily do this:For Typo3 6.2 upwards you may set a custom image render layout (snippet belongs to TS setup):
Enable the custom layout for css_styled_content (snippet belongs to TS constants):
See https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Image/Index.html#cobj-image-layoutkey for details on the IMAGE cObject.
it dont work in 6.1 :/ but u can use CSS:
This is a VERY simple solution with jQuery. i found the answer at wpwizard.net.
Here's the URL: http://wpwizard.net/jquery/remove-img-height-and-width-with-jquery/
Here's the jQuery:
It's not possible to remove the height or width image attributes with typoscript.
But you could override it with CSS in order to create a responsive website.
img { height:100% !important; width:100% !important; }
TypoScript to Remove "width" and "height" attributes from the source code. TYPO3 CMS 6.1+.
tt_news example: News List