[TYPO3] Is it possible to change the img tag?

Lucas Thurston lucas at castironcoding.com
Fri May 30 18:09:13 CEST 2008


Hey Pascal,
Do you want ALL image content elements to be output as divs with 
background images declared inline? My guess is that you don't.  But if 
you do, the change you want to make is in tt_content TypoScript.  You 
were on the right track in the object browser.  It's a CASE object that 
is keyed by various types, the image one (not sure of the actual key 
offhand) is the one you will want to change.

Your new TypoScript would probably be of the COA type with a opening div 
tag as the first part, an IMG_RESOURCE as the second and a closing div 
tag as the third.

For me, the next easiest solution -- there are probably a dozen ways to 
do this -- would be to write a quick plugin.

Lucas

Pascal Cramer wrote:
> Goodmorning everyone,
> 
> I am looking for a way to render an image (from an image element) as 
> background of a div.
> My guess was there would be a wrap where the html of the img tag was 
> defined.
> I've been searching the object browser, sysext\css_styled_content, 
> newslists and Google but cannot find a solution or the location where 
> Typo wraps the file reference with the img tag.
> 
> So what I want is for:
>  <img src="typo3temp/pics/af05f9bade.gif" width="120" height="90" 
> alt="img2" />
> to become:
>  <div style="background-image:url(typo3temp/pics/af05f9bade.gif)"></div>
> 
> Now my questions are:
>  where does Typo wrap the file ref/is it at all possible to change this?
>  are there other/better ways of doing this?
> 
> thanks,
> Pascal


-- 
-----------------------------
Lucas Thurston
Cast Iron Coding - Portland OR, USA
http://www.castironcoding.com
lucas at castironcoding.com


More information about the TYPO3-english mailing list