TCA selectCheckBox - Output in fluid template

2019-09-14 22:58发布

问题:

I use in TCA

        'uebersetzungen' => [
        'exclude' => true,
        'label' => 'LLL:EXT:maschinen/Resources/Private/Language/locallang_db.xlf:tx_maschinen_domain_model_maschine.uebersetzungen',
        'config' => [
            'type' => 'select',
            'renderType' => 'selectSingle',
            'items' => [
                ['6:1', 1],
                ['8:1', 2],
                ['11:1', 3],
                ['14:1', 4],
            ],
            'size' => 4,
            'maxitems' => 1,
            'eval' => ''
        ],
    ],

to get the output in fluid template with

        <f:switch expression="{maschine.uebersetzungen}">
            <f:case value="1">6:1</f:case>
            <f:case value="2">8:1</f:case>
            <f:case value="3">11:1</f:case>
            <f:case value="4">14:1</f:case>
        </f:switch>

Now I want to change the renderType to

'renderType' => 'selectSingleBox'

but I have no idea how to get the several values.

I read TYPO3 TCA type select in FLUID? but I'm not sure whether it's the same problem because I have a different syntax in TCA

回答1:

Thanks to @Paul Beck I found an answer for my problem.

I can use the solution posted here: TYPO3 TCA type select in FLUID?

But I had to change the line

protected $featuresDecoded;

to

protected $featuresDecoded = [];