Search code examples
typo3typo3-8.xtypo3-9.x

get media or images from inline records


in an own, individual content element i use inline records. Output in fluid templates is realized with this data processor:

    20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
    20 {
        table = tx_mytable
        pidInList.field = pid
        where {
            data = field:uid
            intval = 1
            wrap = tt_content=|
        }
        orderBy = sorting
    }

For text fields this works as expected but not for media or images. Media or images are inline records themselves - inline records in inline records ...

Is there a possibility to get the records of media or image fields in inline records?

This does not work obviously:

    30 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
    30 {
        references.fieldName = media
        as = files
    }

It works only with media or image in the main record not in linked inline records. Backend and TCA works as expected, the linked media in the linked inline records are shown correctly. But in fluid i get only [media] = 1.

Any idea how to solve this problem?


Solution

  • Well i found the solution: it is possible to nest data processors:

        20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
        20 {
            table = tx_mytable
            pidInList.field = pid
            where {
                data = field:uid
                intval = 1
                wrap = tt_content=|
            }
            orderBy = sorting
            dataProcessing {
                10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
                10 {
                    references.fieldName = media
                    as = files
                }
            }
        }
    

    This works.