insert specific tt_content element as irre ('type' => 'inline')
Asked Answered
P

3

5

I would like to insert a new specific content element as an inline element. The foreign table would be tt_content.

tt_content as irre

If I do that I am getting all the options (ctype drop down, etc.)

Is it possible have a content element (ctype) preselected and prevent the user from changing that in the inline editing?

'children' => [
        'exclude' => 0,
        'label'   => 'LLL:Label',
        'config'  => [
            'type'          => 'inline',
            'foreign_table' => 'tt_content',
            'foreign_field' => 'parent'
        ]
    ],

enter image description here

Plumule answered 12/9, 2016 at 12:25 Comment(0)
A
10

You can change the default value like this, perhabs you could also override the default palette

    'config' => array(
        'type' => 'inline',
        'foreign_table' => 'tt_content',
        'foreign_field' => 'irre_multitab',
        'foreign_record_defaults' => array(
            'colPos' => '666',
            'CType' => 'text'
        ),
        'foreign_types' => array(
            'header' => array(
                'showitem' => '
                --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.general;general,
                 '
            ),
        ),
Arenicolous answered 12/9, 2016 at 13:9 Comment(0)
F
4

UPDATED ANSWER FOR TYPO3 v8.7+

The usage of foreign_record_defaults is deprecated since v8.7, in favor to use overrideChildTca which gives much more opportunities for overwriting. The above example would look like this:

'children' => [
    'exclude' => 0,
    'label'   => 'LLL:Label',
    'config'  => [
        'type' => 'inline',
        'foreign_table' => 'tt_content',
        'foreign_field' => 'parent',
        'overrideChildTca' => [
            // overwrite whichever children TCA configuration here
        ],
    ]
]
Faria answered 21/1, 2021 at 18:27 Comment(1)
Thank you for posting an updated version.Plumule
H
0

not in an simple way.

have a look at ext:gridelments which inserted the possibility to restrict CE types in columns.

otherwise you could prefill the CType field from page-/user-TSconfig and hide the field with CSS. but so the inputfield is just not visible, with tools like firebug an editor can make them visible again. you can't remove the field from display (in TCA field list) as the field would not be set at all.

Hussey answered 12/9, 2016 at 13:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.