Core API

4.2.4. ['columns'][fieldname] section

The "columns" section contains configuration for each table field (also called "column") which can be edited by the backend.

The configuration includes both properties for the display in the backend as well as the processing of the submitted data.

Each field can be configured as a certain "type" (eg. checkbox, selector, iinput field, text area, file or db-relation field, user defined etc.) and for each type a separate set of additional properties applies. These properties are clearly explained below for each type.

This table showns the keys of the ['columns'][fieldname] array:

Key

Datatype

Description

Scope

label

string

(LS)

Required!

The name of the field as it is shown in the interface:

 


Display

exclude

boolean

If set, all backend users are prevented from editing the field unless they are members of a backend usergroup with this field added as an "Allowed Excludfield" (or "admin" user).

See "Inside TYPO3" document about permissions.

Proc.

l10n_mode

string (keyword)

Localization mode.

Only active if the ctrl-directive "languageField" is set.

 

The main relevance is when a record is localized by an API call in tcemain that makes a copy of the default language record. You can think of this process as copying all fields from the source record, except if a special mode applies as defined below:

 

Keywords are:

  1. exclude � Field will not be shown in TCEforms if this record is a localization of the default language. (Works basically like a display condition.)
    Excluded fields will not be copied when a language-copy is made.
    May have frontend implications similar to "mergeIfNotBlank".

  2. mergeIfNotBlank � Field will be editable but if the field value is blank the value from the default translation is used (this can be very useful for images shared from the default record). Requires frontend support.
    In the backend the effect is that the field content is not copied when a new "localization copy" is made.

  3. noCopy � Like mergeIfNotBlank but without the implications for the frontend; The field is just not copied.

  4. prefixLangTitle � The field will get copied, but the content is prefixed with the title of the language. Works only for field types like "text" and "input"

 

(Doesn't apply to flexform fields.)

Display / Proc.

l10n_display

list of keywords

Localization display.

see: l10n_mode

 

This option can be used to define the language related field rendering. This has nothing to do with the processing of language overlays and data storage but the display of form fields.

 

Keywords are:

  1. hideDiff � The differences to the default language field will not be  displayed.

  2. defaultAsReadonly � This renders the field as read only field with the content of the default language record. The field will be rendered even if 'l10n_mode' is set to 'exclude'. While 'exclude' define the field not to be  translated this option activate display of the default data.

Display

l10n_cat

string

(keyword)

Localization category.

 

Keywords: text,media

 

When localization mode is set for a TCEforms, it must be either of these values. Only the fields that have l10n_cat set to the localization mode is show. Used to limit display so only most relevant fields are shown to translators. It doesn't prevent editing of other fields if records are edited outside localization mode, it merely works as a display condition.

 

It is also used in localization export (pending at this moment).

Display

config

array

Contains the actual configuration properties of the fields display and processing behaviour.

The possibilities for this array depend on the value of the array key "type" within the array. Each valid value for "type" is shown below in a separate table.

 

Notice: For all configuration types, the

  1. "default" key in the array can be used to set the default value of the field.

  2. "softref" key in the array can be used to attach "soft reference parsers". See under "Additional TCA features" for information about softref keys. The syntax for this value is "key1,key2[parameter1;parameter2;...],...".

  3. "type" key is used to denote the field type from a set of keywords, eg. input, text, check, select, group, user. These are documented in individual sections below. Notice: The value of the 'form_type' key overrides this during form rendering, see below.

  4. "form_type" key is used to set an alternative field type which is used when the field is drawn in the form but not when processed elsewhere in the system.

  5. "readOnly" key is used to render the form in a way that the user can see the values but cannot edit them. The rendering is similar to the editable variants but not neccesarily the same and might differ in layout and size.
    Notice: Read only rendering might not be implemented by user defined form items!

-

displayCond

string

Contains a condition rule for whether to display the field or not.

 

A rule is a string divided into several parts by ":" (colons).

The first part is the rule-type and the subsequent parts will depend on the rule type.

Currently these rule values can be used:

  1. FIELD : This evaluates based on another fields value in the record.

    1. Part 1 is the fieldname

    2. Part 2 is the evaluation type. These are the possible options:

      1. REQ : Requires the field to have a  "true" value. False values are "" (blank string) and 0 (zero) or if the field does not exist at all. All else is true.
        For the REQ evaluation type Part3 of the rules string must be the string "true" or "false". If "true" then the rules returns "true" if the evaluation is true. If "false" then the rules returns "true" if the evaluation is false.

      2. > / < / >= / <= : Evaluates if the field value is greater than, less than the value in "Part 3"

      3. = / != : Evaluates if the field value is equal to value in "Part 3" (or not, if the negation flag, "!" is prefixed)

      4. IN / !IN : Evaluates if the field value is in the comma list equal to value in "Part 3" (or not, if the negation flag, "!" is prefixed)

      5. - / !- : Evaluates if the field value is in the range specified by value in "Part 3" ([min] - [max]) (or not, if the negation flag, "!" is prefixed)

  2. EXT : This evaluates based on current status of extensions.

    1. Part 1 is the extension key

    2. Part 2 is the evaluation type:

      1. LOADED : Requires the extension to be loaded if Part3 is "true" and reversed if Part3 is "false".

  3. REC : This evaluates based on the current record (doesn't make sense for flexform fields)

    1. Part 1 is the type.

      1. NEW : Requires the record to be new if Part2 is "true" and reversed if Part2 is "false".

  4. HIDE_L10N_SIBLINGS : (FlexForms only) This evaluates based on whether the field is a value for the default language or an alternative language. Works only for <langChildren>=1, otherwise it has no effect.

    1. Part 1: Keywords: "except_admin" = will still show field to admin users

  5. HIDE_FOR_NON_ADMINS: This will hide the field for all non-admin users while admins can see it. Useful for FlexForm container fields which are not supposed to be edited directly via the FlexForm but rather through TemplaVoilas Page module for instance.

  6. VERSION:

    1. Part 1 is the type:

      1. IS : Part 2 is "true" or "false": If true, the field is shown only if the record is a version (pid == -1)

 

For FlexForm elements the fields are tags on same level. If <langChildren> is enabled, then the value of other fields on same level is taken from the same language.

 

Example:

This example will require the field named "tx_templavoila_ds" to be true, otherwise the field for which this rule is set will not be displayed:

 

      'displayCond' => 'FIELD:tx_templavoila_ds:REQ:true',

This example requires the extension "static_info_tables" to be loaded, otherwise the field is not displayed. (This is useful if the field makes a look-up on a table coming from another extension!)

      'displayCond' => 'EXT:static_info_tables:LOADED:true',

Display

defaultExtras

string

In the "types" configuration of a field you can specify on position 4 a string of "extra configuration". This string will be the default string of extra options for a field regardless of types configuration. For instance this can be used to create an RTE field without having to worry about special configuration in "types" config.

This is also the way by which you can enable the RTE for FlexForm fields.

 

Example value:

 

richtext[cut|copy|paste|formatblock|textcolor|bold|italic|underline|left|center|right|orderedlist|unorderedlist|outdent|indent|link|table|image|line|chMode]:rte_transform[mode=ts_css|imgpath=uploads/tx_mininews/rte/]

 





To top


Valid XHTML 1.0!