能否为frame_class设置默认值?偏好默认无框架(附示例)
none as the Default Value for tt_content.frame_class in TYPO3 Hey there! Great question—yes, you absolutely can set none as the default value for the frame_class field of tt_content elements, and your initial configuration guess is on the right track. Let me walk you through the exact working solutions and details to make this happen:
Working Page TSconfig Approach
Your proposed code is almost spot-on. To make it take effect, add this configuration to your Page TSconfig (you can do this either via the "Resources" tab in a page's properties in the TYPO3 backend, or by adding it to a .tsconfig file in your site package):
TCEFORM { tt_content { frame_class { default = none } } }
This will set the "Frame" dropdown to none by default every time you create a new content element. Don't forget to clear your TYPO3 cache after adding this—changes to TSconfig require a cache flush to apply.
Verify the Change
After updating the configuration and clearing the cache, create a new content element. Head to the "Appearance" tab, and you should see "None" pre-selected in the "Frame" option.
System-Wide Default: TCA Override
If you need this default to apply across your entire TYPO3 instance (all sites), you can override the TCA directly in your site package. Create or edit the file Configuration/TCA/Overrides/tt_content.php and add:
<?php $GLOBALS['TCA']['tt_content']['columns']['frame_class']['config']['default'] = 'none';
For TCA changes, you'll need to clear the system cache (not just the frontend/backend cache) to see the effect.
Edge Case Notes
- If you have extensions that modify the
frame_classfield or set their own defaults, double-check the load order of your configurations. Page TSconfig takes precedence over TCA defaults, but some extensions might load their configurations later—adjust your site package's load order if needed. - Ensure
noneis an available option forframe_class. By default, TYPO3 includes this option, but if you've customized the allowed values in TCA, make surenoneis present in theitemsarray for theframe_classcolumn.
内容的提问来源于stack exchange,提问作者Nicki Schinow

