Skip to content

formatting in TCA files #561

@DavidBruchmann

Description

@DavidBruchmann

Is your feature request related to a problem? Please describe.
Reading and editing types or palettes in TCA files might by nature a bit difficult but it could be easier by different formatting.

Describe the solution you'd like
A self-explanatory example is this:

    'types' => [
        '1' => ['showitem' => 
            'title,'
            . 'sub_title,'
            . 'description,'
            . 'image,'
            . 'category,'
            . '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,'
            . 'sys_language_uid,'
            . 'l10n_parent,'
            . 'l10n_diffsource,'
            . '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,'
            . 'hidden,'
            . 'starttime,'
            . 'endtime'
        ],
    ],

It's easier to resort, to en- or disable fields and to add detailed configuration for tabs and each field.

Alternatives:
configuration in an array which is imploded then. This would avoid comma-faults based on resorting

$types_1_showitem = [
     'title',
     'sub_title',
     'description',
     'image',
     'category',
     '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language',
     'sys_language_uid',
     'l10n_parent',
     'l10n_diffsource',
     '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access',
     'hidden',
     'starttime',
     'endtime',
];

return [
    'ctrl' => [...],
    'types' => [
        '1' => ['showitem' => implode(',', $types_1_showitem]),
    ],
    'columns' => [...],
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions