[TYPO3-dam] reading image from DAM in TS

Ernesto Baschny [cron IT] ernst at cron-it.de
Tue May 23 13:54:02 CEST 2006


Krystian Szymukowicz schrieb am 23.05.2006 13:34:

> I went through all DAM extensions and DAM newsgroup but can't find answer.
> 
> How can I read files from DAM in TS?
> 
> The old way when I wanted to read from tt_content was for example:
> 
>     10 = IMAGE
>     10.file {
>      import = uploads/pics/
>      import.field = image
>      import.listNum = 0
>     }
> 
> How to read them now from DAM?
> 
> I have ext "Content/DAM reference usage (dam_ttcontent)" installed
> and ctype_textpic_add_orig_field disabled.

This is being done in dam_ttcontent already, so you just have to look
how it does it:

        includeLibs.tx_damttcontent = EXT:dam/lib/class.tx_dam_tsfe.php
        temp.tx_dam.fileList < tt_content.image.20.imgList
        tt_content.image.20.imgList >
        tt_content.image.20.imgList.cObject = USER
        tt_content.image.20.imgList.cObject {
            userFunc = tx_dam_tsfe->fetchFileList
            refField = tx_damttcontent_files
            additional.fileList < temp.tx_dam.fileList
            additional.filePath < tt_content.image.20.imgPath
 ...

So just call "tx_dam_tsfe->fetchFileList" in an USER object. This should
return the same as "field = image" in the non-dam variant, so something
like that might work:

     10 = IMAGE
     10.file {
      import = uploads/pics/
      import.cObject = USER
      import.cObject.userFunc = tx_dam_tsfe->fetchFileList
      import.cObject.refField = <field where you store the dam references>
      import.listNum = 0
     }

Cheers,
Ernesto



More information about the TYPO3-project-dam mailing list