Proc. / Display
Specifies which publishing control features are automatically implemented for the table.
This includes that records can be "disabled" or "hidden", have a starting and/or ending time and be access controlled so only a certain front end user group can access them. This property is used by the RestrictionBuilder to create SQL fragments.
These are the keys in the array you can use. Each of the values must be a field name in the table which should be used for the feature:
Defines which field serves as hidden/disabled flag.
Defines which field contains the starting time.
Defines which field contains the ending time.
Defines which field is used for access control via a selection of FE user groups.
In general these fields do not affect the access or display in the backend! They are primarily related to the frontend. However the icon of records having these features enabled will normally change as these examples show:
See also the delete feature which is related, but is active for both frontend and backend.
Make table hideable¶
<?php return [ 'ctrl' => [ 'enablecolumns' => [ 'disabled' => 'hidden', ], // ... ], 'columns' => [ 'hidden' => [ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.enabled', 'config' => [ 'type' => 'check', 'renderType' => 'checkboxToggle', 'items' => [ [ 0 => '', 1 => '', 'invertStateDisplay' => true ] ], ] ], // ... ], ];
Common enable fields¶
'ctrl' => [ 'enablecolumns' => [ 'disabled' => 'hidden', 'starttime' => 'starttime', 'endtime' => 'endtime', ], ]
Enablecolumns / enablefields usage¶
Most ways of retrieving records in the frontend automatically respect the
Enablecolumns in TypoScript¶
Enablecolumns / enablefields in Extbase¶
In Extbase repositories the records are hidden in the frontend by default, however this behaviour can be disabled by setting $querySettings->setIgnoreEnableFields(true).
Enablecolumns in queries¶
Using the QueryBuilder enable columns restrictions are automatically applied.
The same is true when select() is called on the connection.
See the RestrictionBuilder for details.
However this could be disabled by setting:
// use TYPO3\CMS\Core\Utility\GeneralUtility; // use TYPO3\CMS\Core\Database\ConnectionPool; // use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages'); $queryBuilder ->getRestrictions() // Use with care, the following may reveal information: ->removeAll() ->add(GeneralUtility::makeInstance(DeletedRestriction::class));