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

Pascal Cramer pascal at NOSPAMroguesheep.nl
Fri May 30 12:38:08 CEST 2008


Christopher Torgalson wrote:
> Hi,
> 
> On Fri, May 30, 2008 at 10:40 AM, Pascal Cramer
> <pascal at nospamroguesheep.nl> 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?
> 
> 
> All that searching and you missed the one authoritative Typoscript
> reference: the TSref [1] :-)
> 
> You're looking for the IMG_RESOURCE cObject [2]. Note also that both
> the IMG_RESOURCE and IMAGE cObjects populate the TSFE array with
> information about the last rendered images--this info can be accessed
> by Typoscript or by PHP scripts.
> 
> 
> 
> [1] http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/
> [2] http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/8/7/

Hi Christopher,

I did not miss this 'work of art', just forgot to mention it :P

I did see in the ref the description of the IMG_RESOURCE but how do I get the 
images user inserted in the BE into this cObject.
The only examples I found (fe 
http://typo3.org/documentation/document-library/core-documentation/doc_core_tsbyex/0.0.16/view/5/1/
) on using IMG_RESOURCE in TS were putting _one_ image (hardcoded) in _one_ 
cObject where I need multiple images and probably more cObjects?

I think I lack some experience and therefore an overview of the possibilities of 
TS on this matter.
Could you give me a hint on what command/option I should take a look in the 
TSref (after all: it is a reference not a step-by-step guie ;-) me on this or 
know useful example on the web?

Many thanks,
Pascal


More information about the TYPO3-english mailing list