eval

eval
Path

$GLOBALS['TCA'][$table]['columns'][$field]['config']

type

string (list of keywords)

Scope

Proc. / Display

Configuration of field evaluation.

Keywords:

unique
Evaluate if a record is unique in the whole TYPO3 installation (specific to a language). This option is recommended as it allows to show any record stored inside other sites. The only downside is that it is not possible to have the same slug on multiple sites.
uniqueInSite

Requires the field to be unique for the current site and language. This allows for multiple records of the same table to have the same slug as long as these records are separated by their sites. Consequently records of a foreign site are not accessible with uniqueInsite since slugs are looked up respecting the current site.

uniqueInPid
Requires the field to be unique for the current PID among other records on the same page.

No other eval setting is checked for. It is possible to set different eval options, however it is recommended not to do so.

Examples

eval = uniqueInSite

EXT:styleguide/Configuration/TCA/tx_styleguide_elements_slugs.php
[
    'columns' => [
        'slug_2' => [
            'exclude' => 1,
            'label' => 'slug_2',
            'config' => [
                'type' => 'slug',
                'size' => 50,
                'generatorOptions' => [
                    'fields' => [
                        'input_1',
                    ],
                    'fieldSeparator' => '/',
                    'prefixParentPageSlug' => true,
                ],
                'fallbackCharacter' => '-',
                'eval' => 'uniqueInSite',
                'default' => '',
            ],
        ],
    ],
]
Copied!