Text areas & RTE

Introduction

The text type is for multi-line text input, in the database ext_tables.sql files it is typically set to a TEXT column type. In the backend, it is rendered in various shapes: It can be rendered as a simple <textarea>, as a rich text editor (RTE), as a code block with syntax highlighting, and others.

The following renderTypes are available:

  • default: A simple text area or a rich text field is rendered, if no renderType is specified.

  • belayoutwizard: The backend layout wizard is displayed in order to edit records of table backend_layout in the backend.

  • t3editor: The renderType = 't3editor' triggers a code highlighter, if extension t3editor is loaded, otherwise falls back to the "default" renderType.

  • textTable: The renderType = 'textTable' triggers a view to manage frontend table display in the backend. It is used for the "table" tt_content content element.

Simple text area

A simple text area or a rich text field is rendered, if no renderType is specified.

../../../_images/Text4.png

See render type "default" on how to configure such an editor.

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
    'columns' => [
        'text_4' => [
            'exclude' => 1,
            'label' => 'text_4',
            'description' => 'cols=20, rows=2',
            'config' => [
                'type' => 'text',
                'cols' => 20,
                'rows' => 2,
            ],
        ],
    ],
]

Rich text editor field

../../../_images/Rte1.png

See property "enableRichtext" on how to configure such an editor.

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_rte.php
[
    'columns' => [
        'rte_1' => [
            'exclude' => 1,
            'label' => 'rte_1 description',
            'description' => 'field description',
            'config' => [
                'type' => 'text',
                'enableRichtext' => true,
            ],
        ],
    ],
]

Code highlight editor

See t3editor on how to configure such an editor.

[
    // ...
    'type' => 'text',
    'renderType' => 't3editor',
    // ...
]

Backend layout editor

The backend layout wizard is displayed in order to edit records of table backend_layout in the backend.

../../../_images/Text20.png

See render type belayoutwizard on how to configure such an editor.

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
    'columns' => [
        'text_20' => [
            'label' => 'text_20',
            'description' => 'renderType=belayoutwizard',
            'config' => [
                'type' => 'text',
                'renderType' => 'belayoutwizard',
                'default' => '
backend_layout {
  colCount = 2
  rowCount = 2
  rows {
    1 {
      columns {
        1 {
          name = Left
          rowspan = 2
          colPos = 1
        }
        2 {
          name = Main
          colPos = 0
        }
      }
    }
    2 {
      columns {
        1 {
          name = Footer
          colPos = 24
        }
      }
    }
  }
}',
            ],
        ],
    ],
]

Text field with renderType textTable

../../../_images/Text17.png

The table wizard allows to edit the code-like configuration of the tables with a visual editor.

See render type textTable on how to configure such an editor.

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_basic.php
[
    'columns' => [
        'text_17' => [
            'label' => 'text_17',
            'description' => 'renderType=textTable',
            'config' => [
                'type' => 'text',
                'renderType' => 'textTable',
            ],
        ],
    ],
]