bschauer
bschauer

Reputation: 1008

Typoscript SQL select (DataProcessing)

I want to get a record from another table into the current element.

Here is my Typoscript. I need something like that:

where = uid = 3 (this should be current tx_my_doors record > field:features)

have a look at "20" in the TS.

tt_content.irre_doors =< lib.default
tt_content.irre_doors {
    templateName = IRRE_Doors
    dataProcessing {
        5 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
        5 {
            table = tx_my_doors
            pidInList.field = pid
            where {
                data = field:uid
                intval = 1
                wrap = tt_content=|
            }
            orderBy = sorting
            as = doors
            dataProcessing {
                10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
                10 {
                    references.fieldName = image
                    as = images
                }
                20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
                20 {
                    table = tx_my_product_features
                    pidInList = 26
                    where = uid = 3 (this should be current tx_my_doors record > field:features)
                    orderBy = sorting
                    as = test
                }
            }
        }
    }
}

Upvotes: 0

Views: 1261

Answers (2)

Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10791

keep in mind that you can use markers as you may find in the TS manual for select

as you can use stdWrap you might build complex queries

Upvotes: 1

Jpsy
Jpsy

Reputation: 20852

Did you try this? (untested)

            20 {
                table = tx_my_product_features
                pidInList = 26
                where {
                    data = field:features
                    wrap = uid=|
                }
                orderBy = sorting
                as = test
            }

Upvotes: 1

Related Questions