Issue Bug Closed

#95428different behaviour for "Standard" option in frame-class vs space-before/after classes

David Menzel 10/01/21, 09:54 updated 08/12/25, 14:35

Description

I added a new frame_class option called ‘container’.
Then I have overridden the standard option for the frame_class and space_before_class / space_after_class fields in my_ext/Configuration/TCA/Overrides/tt_content.php like:

$GLOBALS[‘TCA’][‘tt_content’][‘types’][‘textmedia’][‘columnsOverrides’][‘frame_class’][‘config’][‘default’] = ‘container’;

$GLOBALS[‘TCA’][‘tt_content’][‘types’][‘textmedia’][‘columnsOverrides’][‘space_before_class’][‘config’][‘default’] = ‘medium’;
$GLOBALS[‘TCA’][‘tt_content’][‘types’][‘textmedia’][‘columnsOverrides’][‘space_after_class’][‘config’][‘default’] = ‘medium’;

So, if I create a new Text&Media content element, the default values for
*frame_class* would be container and
*space_before_class* = medium and space_after_class = medium

I can then change the option in the frame_class back to Standard or any other value that’s available in the dropdown.

The same can’t be done in the space_before/after_class fields.
If I choose the Standard option the value jumps back to medium. So, selecting the Standard option (which would mean zero space) is not possible anymore.

To solve this, I changed the TCA config for space_before_class / space_after_class in public/typo3/sysext/frontend/Configuration/TCA/tt_content.php to

‘space_before_class’ => [
‘exclude’ => true,
‘label’ => ‘LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:space_before_class’,
‘config’ => [
‘type’ => ‘select’,
‘renderType’ => ‘selectSingle’,
‘items’ => [
[‘LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.default_value’, ‘default’ ],
…..
],
‘default’ => *‘default’*
]
],

After changing the empty value to a string, I can now select the default value in the space_after/before_class field again.
It seems that the problem is the empty value…?

Because the Standard option has “no space” at all, I would suggest to rename the Standard option to “Kein Abstand” with the value “none”.
I assume that would solve the problem.

Or add default as value to the Standard option…

Reviews 2

Files 2

History 613

  1. Georg Ringer commented and changed attached Bildschirmfoto 2024-06-23 um 21.45.37.png status New Closed <span data-processor="relativetime" data-value="2024-06-23T19:46:27+00:00" > 06/23/24, 19:46 </span>

    thanks for creating the issue. checking that out in v13 seems that this now works (probably also in v12)

    Bildschirmfoto%202024-06-23%20um%2021.45.37.png

  2. Gerrit Code Review pushed patch set 1 for main to change 84934 status Accepted Under Review <span data-processor="relativetime" data-value="2024-06-26T17:42:05+00:00" > 06/26/24, 17:42 </span>

  3. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-02-18T14:50:09+00:00" > 02/18/25, 14:50 </span>

    Applied in changeset commit:916e8564e3fa41432b48ac6e65415fb81c584b85.