0

I followed a tutorial to implement custom content elements in TYPO3. I don't understand how to configure backend fields.

Here is my override for tt_content:

$GLOBALS['TCA']['tt_content']['types']['my_custom_ce'] = [
    'showitem'         => '
            --palette--;' . $frontendLanguageFilePrefix . 'palette.general;general,
            --linebreak--, header;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_formlabel,
            --linebreak--, date;Datum,
            --linebreak--, media;Media,
            --linebreak--, bodytext;text,
];

I would like for example to change the textarea size for the "bodytext" field. I read the official TCA reference but still don't get how this is working

user6800816
  • 503
  • 7
  • 26

1 Answers1

1

The change of textarea fild size is done in

$GLOBALS['TCA']['tt_content']['columns']['bodytext']['config'] etc.

Look for details in the TCA reference.

This changes the field size for all CEs. As far as I know it is not possible to change this only for one CE.

Stefan Padberg
  • 505
  • 2
  • 17
  • Thanks it works. What if my CE has multiple bodytext fields ? Is there a way to configure each field ? – user6800816 Mar 06 '17 at 09:02
  • It is not possible to have multiple `bodytext` fields. `bodytext` is a column in the `tt_content` table. It is not possible to have multiple columns of the same name in a table. – Stefan Padberg Mar 07 '17 at 09:25
  • If I need multiple text fields, I guess I should create new columns with "addTCAcolumns" and "addToAllTCAtypes" ? I dont know if this best pratice – user6800816 Mar 07 '17 at 09:51
  • Yes, a new column, or use the `subheader` column f.e. if it is not used already. - Don't forget to change the SQL definition of the table if you add a new column! - But this is a new question. Please have a look whether there are already answers for this question or post a new one. – Stefan Padberg Mar 08 '17 at 10:58