diff --git a/Documentation/BestPractises/CommonFields.rst b/Documentation/BestPractises/CommonFields.rst index 3183886d..96db494e 100644 --- a/Documentation/BestPractises/CommonFields.rst +++ b/Documentation/BestPractises/CommonFields.rst @@ -47,7 +47,7 @@ Soft delete This field is used to enable soft delete in records. In can be configured by setting :ref:`ctrl->delete `: - .. literalinclude:: /Ctrl/Properties/_CodeSnippets/_Delete.php + .. literalinclude:: /Ctrl/_CodeSnippets/_Delete.php :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php @@ -74,7 +74,7 @@ Enablecolumns This field is used to enable soft hiding of records. In can be configured by setting :ref:`ctrl->enablecolumns->disabled `: - .. literalinclude:: /Ctrl/Properties/_CodeSnippets/_Hidden.php + .. literalinclude:: /Ctrl/_CodeSnippets/_Hidden.php :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php .. _field_starttime: @@ -85,7 +85,7 @@ Enablecolumns an endtime. In can be configured by :ref:`ctrl->enablecolumns->starttime or endtime `: - .. literalinclude:: /Ctrl/Properties/_CodeSnippets/_StarttimeEndtime.php + .. literalinclude:: /Ctrl/_CodeSnippets/_StarttimeEndtime.php :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php .. _field_fe_group: @@ -94,7 +94,7 @@ Enablecolumns This field is used to enable soft delete of records. In can be configured by :ref:`ctrl->enablecolumns->fe_group `: - .. literalinclude:: /Ctrl/Properties/_CodeSnippets/_FeGroup.php + .. literalinclude:: /Ctrl/_CodeSnippets/_FeGroup.php :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php .. warning:: @@ -111,7 +111,7 @@ Manual sorting in the backend This field is used to manually sort records in the backend. In can be configured by :ref:`ctrl->sortby `: - .. literalinclude:: /Ctrl/Properties/_CodeSnippets/_Sorting.php + .. literalinclude:: /Ctrl/_CodeSnippets/_Sorting.php :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php .. attention:: @@ -132,7 +132,7 @@ The following fields are automatically set when a record is written by the displayed in backend forms or explicitly set, therefore they need no entry in the :ref:`columns` section of the TCA. -.. literalinclude:: /Ctrl/Properties/_CodeSnippets/_DataHandlerFields.php +.. literalinclude:: /Ctrl/_CodeSnippets/_DataHandlerFields.php :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php .. _field_tstamp: diff --git a/Documentation/BestPractises/LanguageFields.rst b/Documentation/BestPractises/LanguageFields.rst index 78a67b68..76addc97 100644 --- a/Documentation/BestPractises/LanguageFields.rst +++ b/Documentation/BestPractises/LanguageFields.rst @@ -86,6 +86,6 @@ Language fields in detail Example: Enable table for localization and translation: ======================================================= -.. literalinclude:: /Ctrl/Properties/_CodeSnippets/_Language.php +.. literalinclude:: /Ctrl/_CodeSnippets/_Language.php :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php diff --git a/Documentation/Ctrl/AutoCreatedColumns.rst b/Documentation/Ctrl/AutoCreatedColumns.rst index c6a83026..01069944 100644 --- a/Documentation/Ctrl/AutoCreatedColumns.rst +++ b/Documentation/Ctrl/AutoCreatedColumns.rst @@ -1,3 +1,5 @@ +:navigation-title: Auto-created columns + .. include:: /Includes.rst.txt .. _ctrl-auto-created-columns: @@ -63,17 +65,17 @@ then override single properties in :file:`Configuration/TCA/Overrides` files. As example, "base" :php:`pages` file defines this (step 1 above): -.. literalinclude:: _AutoCreatedColumns/_pages.php +.. literalinclude:: _CodeSnippets/_AutoCreatedColumns/_pages.php :caption: EXT:core/Configuration/TCA/pages.php (Excerpt) The Core thus creates this :php:`columns` definition (step 2 above): -.. literalinclude:: _AutoCreatedColumns/_autoCreatePages.php +.. literalinclude:: _CodeSnippets/_AutoCreatedColumns/_autoCreatePages.php :caption: Column entries created by the Core When an editor creates a new page, it should be "disabled" by default to avoid having a new page online in the website before it is set up completely. A :file:`Configuration/TCA/Overrides/pages.php` file does this: -.. literalinclude:: _AutoCreatedColumns/_OverrideHiddenDefault.php +.. literalinclude:: _CodeSnippets/_AutoCreatedColumns/_OverrideHiddenDefault.php :caption: EXT:my_extension/Configuration/TCA/Overrides/pages.php diff --git a/Documentation/Ctrl/Properties/Enablecolumns.rst b/Documentation/Ctrl/EnableColumns.rst similarity index 57% rename from Documentation/Ctrl/Properties/Enablecolumns.rst rename to Documentation/Ctrl/EnableColumns.rst index d3288e23..23f01be2 100644 --- a/Documentation/Ctrl/Properties/Enablecolumns.rst +++ b/Documentation/Ctrl/EnableColumns.rst @@ -1,61 +1,21 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-enablecolumns: - -============= -enablecolumns -============= - -.. confval:: enablecolumns - :name: ctrl-enablecolumns - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: array - :Scope: Proc. / Display - - .. versionchanged:: 13.3 - The column definitions for these settings are :ref:`auto-created `. - - 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 - :ref:`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: - - `disabled` - Defines which field serves as hidden/disabled flag. - - `starttime` - Defines which field contains the starting time. - - `endtime` - Defines which field contains the ending time. +:navigation-title: Enabling columns - `fe_group` - Defines which field is used for access control via a selection of FE user groups. - - .. note:: - 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: - - .. include:: /Images/Rst/CtrlEnableFields.rst.txt - - .. include:: _AutoCreateWarning.rst.txt +.. include:: /Includes.rst.txt +.. _ctrl-enablecolumns: - See also the :ref:`delete ` and - :ref:`ctrl-reference-editlock` features which are related, - but are active for both frontend and backend. +======================================================= +How to use `enablecolumns` in the `ctrl` section of TCA +======================================================= .. _ctrl-reference-enablecolumns-migration: -Migration: Remove enable column definitions (hidden, starttime, endtime, fe_groups) from TCA -============================================================================================ +Migration +========= +Migration: Remove enable column definitions (hidden, starttime, endtime, fe_groups) from TCA On dropping TYPO3 v12.4 support extensions authors can drop the column definitions of the enable fields. They need to keep the :ref:`palettes` and -:ref:`type` definitions, however: +:ref:`types` definitions, however: .. literalinclude:: _CodeSnippets/_Enablecolumns.diff :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php @@ -65,11 +25,11 @@ definitions of the enable fields. They need to keep the :ref:`palettes` and Examples of column enable configurations ======================================== -.. _ctrl-reference-enablecolumns-examples-all: - .. literalinclude:: _CodeSnippets/_Enablecolumns.php :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php +.. _ctrl-reference-enablecolumns-examples-all: + Define all enablecolumn fields ============================== diff --git a/Documentation/Ctrl/Examples.rst b/Documentation/Ctrl/Examples.rst index 7601a770..a365a316 100644 --- a/Documentation/Ctrl/Examples.rst +++ b/Documentation/Ctrl/Examples.rst @@ -1,18 +1,24 @@ -.. include:: /Includes.rst.txt -.. _ctrl-examples: +:navigation-title: Examples -======== -Examples -======== +.. include:: /Includes.rst.txt +.. _ctrl-examples: -.. _tca_example_ctrl_minimal: +============================================== +Examples demonstrating the ctrl section of TCA +============================================== + +A common table has a configuration such as this: + +.. include:: /CodeSnippets/TxStyleguideCtrlCommon.rst.txt + +.. _tca_example_ctrl_minimal: Minimal table configuration =========================== -.. include:: /Images/Rst/TxStyleguideCtrlMinimal.rst.txt +.. include:: /Images/Rst/TxStyleguideCtrlMinimal.rst.txt -.. include:: /CodeSnippets/TxStyleguideCtrlMinimal.rst.txt +.. include:: /CodeSnippets/TxStyleguideCtrlMinimal.rst.txt Property :code:`label` is a mandatory setting, but the above properties are a recommended minimum. The list module shows an icon and a translated title of the table, and it uses the value of @@ -22,41 +28,76 @@ possible, and much more. In the database, only columns :code:`uid`, :code:`pid` in :file:`ext_tables.sql` with this setup. -.. _tca_example_ctrl_common: - -Common table control configuration -================================== - -.. include:: /Images/Rst/TxStyleguideCtrlCommon.rst.txt - -.. include:: /CodeSnippets/TxStyleguideCtrlCommon.rst.txt - -.. _tca_example_ctrl_tt_content: +.. _tca_example_ctrl_tt_content: Core table tt_content ===================== Table :code:`tt_content` makes much more excessive use of the :code:`['ctrl']` section: -.. include:: /CodeSnippets/TtContentCtrl.rst.txt +.. include:: /CodeSnippets/TtContentCtrl.rst.txt A few remarks: -- When tt_content records are displayed in the backend, the "label" property - indicates that you will see the content from the field named "header" - shown as the title of the record. If that field is empty, the content of field - subheader and if empty, of field bodytext is used as title. +* When tt_content records are displayed in the backend, the "label" property + indicates that you will see the content from the field named "header" + shown as the title of the record. If that field is empty, the content of field + subheader and if empty, of field bodytext is used as title. + +* The field called "sorting" will be used to determine the order in + which tt_content records are displayed within each branch of the page tree. + +* The title for the table as shown in the backend is defined as coming from a "locallang" file. + +* The "type" field will be the one named "CType". The value of this field determines the set of fields + shown in the edit forms in the backend, see the :ref:`['types'] ` section for details. + +* Of particular note is the "enablecolumns" property. It is quite extensive for this table since it is a + frontend-related table. Thus proper access rights, publications dates, etc. must be enforced. + +* Every type of content element has its own icon and its own class, used in conjunction with the + :ref:`Icon API ` to visually represent that type in the TYPO3 backend. + + +.. _tca_example_ctrl_container: + +Extended container examples +=========================== + +.. _tca_example_ctrl_container-disable: + +Disable a built-in wizard +------------------------- + +.. literalinclude:: _CodeSnippets/_disableFieldWizard.php + +This disables the default :php:`localizationStateSelector` fieldWizard of +:php:`inlineControlContainer`. + +.. _tca_example_ctrl_container-cusotm: + +Add your own wizard +------------------- + +Register an own node in a :file:`ext_localconf.php`: + +.. literalinclude:: _CodeSnippets/_WizardRegistration/_ext_localconf.php + :caption: EXT:my_extension/ext_localconf.php + +Register the new node as `fieldWizard` of `tt_content` table in an +:file:`Configuration/TCA/Overrides/tt_content.php` file: + +.. literalinclude:: _CodeSnippets/_WizardRegistration/_ext_localconf.php + :caption: EXT:my_extension/Configuration/TCA/Overrides/tt_content.php -- The field called "sorting" will be used to determine the order in - which tt_content records are displayed within each branch of the page tree. +In PHP, the node has to implement an interface, but can return any additional HTML which is rendered in the +"OuterWrapContainer" between the record title and the field body when editing a record: -- The title for the table as shown in the backend is defined as coming from a "locallang" file. +.. include:: /Images/ManualScreenshots/OuterFieldWizard.rst.txt -- The "type" field will be the one named "CType". The value of this field determines the set of fields - shown in the edit forms in the backend, see the :ref:`['types'] ` section for details. +.. _tca_example_ctrl_container-inline: -- Of particular note is the "enablecolumns" property. It is quite extensive for this table since it is a - frontend-related table. Thus proper access rights, publications dates, etc. must be enforced. +Add fieldInformation to field of type inline +-------------------------------------------- -- Every type of content element has its own icon and its own class, used in conjunction with the - :ref:`Icon API ` to visually represent that type in the TYPO3 backend. +This example can be found in :ref:`inline-example-field-information`. diff --git a/Documentation/Ctrl/Index.rst b/Documentation/Ctrl/Index.rst index c3e62fe7..609cd68a 100644 --- a/Documentation/Ctrl/Index.rst +++ b/Documentation/Ctrl/Index.rst @@ -17,10 +17,35 @@ These properties are basically divided into two main categories: (TCE). This includes the publishing control, the "deleted" flag, whether a table can only be edited by admin-users, whether a table may only exist in the tree root etc. +.. contents:: .. toctree:: :titlesonly: + :glob: - AutoCreatedColumns - Examples - Properties/Index + * + +.. _tca_example_ctrl_common: + +Example: Common table control configuration +=========================================== + +For advanced examples see :ref:`ctrl-examples`. + +.. include:: /Images/Rst/TxStyleguideCtrlCommon.rst.txt + +.. include:: /CodeSnippets/TxStyleguideCtrlCommon.rst.txt + +.. _ctrl-reference: + +Properties of the TCA ctrl section +================================== + +.. confval-menu:: + :name: ctrl + :display: table + :type: + :Scope: + + .. include:: _Properties/_*.rst.txt + :show-buttons: diff --git a/Documentation/Ctrl/Properties/AdminOnly.rst b/Documentation/Ctrl/Properties/AdminOnly.rst deleted file mode 100644 index 8b4b11ff..00000000 --- a/Documentation/Ctrl/Properties/AdminOnly.rst +++ /dev/null @@ -1,27 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-adminonly: - -========= -adminOnly -========= - -.. confval:: adminOnly - :name: ctrl-adminOnly - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: boolean - :Scope: Proc. / Display - - Records can be changed *only* by "admin"-users (having the "admin" flag set). - -Examples -======== - -Table :sql:`my_table` is only editable by admin users: - -.. code-block:: php - :caption: EXT:my_sitepackage/Configuration/TCA/my_table.php - - 'ctrl' => [ - 'adminOnly' => 1, - ... - ], diff --git a/Documentation/Ctrl/Properties/Container.rst b/Documentation/Ctrl/Properties/Container.rst deleted file mode 100644 index 9e3ed0cf..00000000 --- a/Documentation/Ctrl/Properties/Container.rst +++ /dev/null @@ -1,130 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-container: - -========= -container -========= - -.. confval:: container - :name: ctrl-container - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: array - :Scope: Display - - - Array to configure additional items in render containers of :ref:`FormEngine `, - see section :ref:`Node expansion `. - - Next to single elements, some render container allow to be "enriched" with additional information via - the "node expansion" API. Currently, the :php:`OuterWrapContainer` implements :php:`fieldWizard` and - :php:`fieldInformation`. :php:`InlineControlContainer` implements :php:`fieldWizard` and comes with - the default wizard :php:`localizationStateSelector`. Custom containers may implement expansion nodes, too, - and if implemented correctly will automatically have their configuration merged with the definition - provided in this TCA array. - - The basic array looks like:: - - 'ctrl' => [ - 'container' => [ - '' => [ - 'fieldWizard' => [ - '' => [ - 'renderType' => '', - 'before' => [''], - 'after' => [''], - 'disabled' => false, - 'options' => [], - ], - ], - ], - ], - ], - - - should be a defined container render type. - You can find more about the :code:`outerWrapContainer` and - :code:`inlineControlContainer` in the FormEngine documentation section on - :ref:`rendering `. - Valid types are for example: - - - :code:`outerWrapContainer` type which corresponds to the - :php:`OuterWrapContainer` (class). - - :code:`inlineControlContainer` type which corresponds to the - :php:`InlineControlContainer` class - - :code:`inline` type which corresponds to the :php:`InlineControlContainer` - class. - - renderType - refers to a registered node name from :php:`NodeFactory` - - before, after - can be set to sort single wizards relative to each other. - - disabled - can be used to disable built in default wizards. - - options - Some wizards may support additional "options". - - Note, next to "fieldWizard", some containers may also implement "fieldInformation", which can be - manipulated the same way. - -Examples -======== - -Disable a built-in wizard -------------------------- - -.. code-block:: php - - 'ctrl' => [ - 'container' => [ - 'inlineControlContainer' => [ - 'fieldWizard' => [ - 'localizationStateSelector' => [ - 'disabled' => true, - ], - ], - ], - ], - ], - -This disables the default :php:`localizationStateSelector` fieldWizard of -:php:`inlineControlContainer`. - - -Add your own wizard -------------------- - -Register an own node in a :file:`ext_localconf.php`:: - - $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1486488059] = [ - 'nodeName' => 'ReferencesToThisRecordWizard', - 'priority' => 40, - 'class' => \T3G\AgencyPack\EditorsChoice\FormEngine\FieldWizard\ReferencesToThisRecordWizard::class, - ]; - - - -Register the new node as "fieldWizard" of "tt\_content" table in an :file:`Configuration/TCA/Overrides/tt\_content.php` -file:: - - $GLOBALS['TCA']['tt_content']['ctrl']['container'] = [ - 'outerWrapContainer' => [ - 'fieldWizard' => [ - 'ReferencesToThisRecordWizard' => [ - 'renderType' => 'ReferencesToThisRecordWizard', - ], - ], - ], - ]; - -In PHP, the node has to implement an interface, but can return any additional HTML which is rendered in the -"OuterWrapContainer" between the record title and the field body when editing a record: - -.. include:: /Images/ManualScreenshots/OuterFieldWizard.rst.txt - -Add fieldInformation to field of type inline --------------------------------------------- - -This example can be found in :ref:`inline-example-field-information`. diff --git a/Documentation/Ctrl/Properties/CopyAfterDuplFields.rst b/Documentation/Ctrl/Properties/CopyAfterDuplFields.rst deleted file mode 100644 index 2c2fa0b0..00000000 --- a/Documentation/Ctrl/Properties/CopyAfterDuplFields.rst +++ /dev/null @@ -1,27 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-copyafterduplfields: - -=================== -copyAfterDuplFields -=================== - -.. confval:: copyAfterDuplFields - :name: ctrl-copyAfterDuplFields - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: string (list of field names) - :Scope: Proc. - - - The fields in this list will automatically have the value of the same field from the "previous" record transferred - when they are *copied* to the position *after* another record from same table. - -Examples -======== - -Example from "tt\_content" table:: - - 'ctrl' => [ - 'copyAfterDuplFields' => 'colPos, sys_language_uid', - ... - ], - diff --git a/Documentation/Ctrl/Properties/Crdate.rst b/Documentation/Ctrl/Properties/Crdate.rst deleted file mode 100644 index a54021b7..00000000 --- a/Documentation/Ctrl/Properties/Crdate.rst +++ /dev/null @@ -1,30 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-crdate: - -====== -crdate -====== - -.. confval:: crdate - :name: ctrl-crdate - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: string (field name) - :Scope: Proc. - - Field name, which is automatically set to the current timestamp when - the record is created. Is never modified again. - - By convention the name :ref:`crdate ` is used for that field. - - .. note:: - The database field configured in this property is created automatically. - It does not have to be added to the :file:`ext_tables.sql`. - -Examples -======== - -The following fields are set by the DataHandler automatically on creating or -updating records, if they are configured in the :php:`ctrl` section of the TCA: - -.. literalinclude:: _CodeSnippets/_DataHandlerFields.php - :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php diff --git a/Documentation/Ctrl/Properties/DefaultSortby.rst b/Documentation/Ctrl/Properties/DefaultSortby.rst deleted file mode 100644 index 31e5ea8c..00000000 --- a/Documentation/Ctrl/Properties/DefaultSortby.rst +++ /dev/null @@ -1,43 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-default-sortby: - -=============== -default\_sortby -=============== - -.. confval:: default_sortby - :name: ctrl-default-sortby - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: string - :Scope: Display - - - If a field name for :ref:`sortby ` is defined, then this is ignored. - - Otherwise this is used as the 'ORDER BY' statement to sort the records in the table when listed in the TYPO3 backend. - It is possible to have multiple field names in here, and each can have an ASC or DESC keyword. Note that the value - *should not* be prefixed with 'ORDER BY' in itself. - -Examples -======== - -Sort by title:: - - 'ctrl' => [ - 'default_sortby' => 'title', - ... - ], - -Sort by title and then by creation date:: - - 'ctrl' => [ - 'default_sortby' => 'title ASC, crdate DESC', - ... - ], - -.. warning:: - Do not confuse this property with :ref:`sortby `: default_sortby should be set only if there - is no :ref:`sortby `. The sortby field (typically set to `sorting`) contains an integer - for explicit sorting , the backend then shows "up" and "down" buttons to manage sorting of records relative - to each other. The default\_sortby should only be set if that explicit sorting is not wanted or useful. For - instance, the list of frontend users is sorted by username and has no other explicit sorting field in the database. diff --git a/Documentation/Ctrl/Properties/Delete.rst b/Documentation/Ctrl/Properties/Delete.rst deleted file mode 100644 index 80b50db4..00000000 --- a/Documentation/Ctrl/Properties/Delete.rst +++ /dev/null @@ -1,30 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-delete: - -====== -delete -====== - -.. confval:: delete - :name: ctrl-delete - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: string (field name) - :Scope: Proc. / Display - - - Field name, which indicates if a record is considered deleted or not. - - If this "soft delete" feature is used, then records are not really deleted, but just marked as 'deleted' by setting - the value of the field name to "1". In turn, the whole system *must* strictly respect the record as deleted. This - means that any SQL query must exclude records where this field is true. - - This is a very common feature. Most tables use it throughout the TYPO3 Core. The core extension "recycler" - can be used to "revive" those deleted records again. - -Example -======= - -Enable soft delete for the following table: - -.. literalinclude:: _CodeSnippets/_Delete.php - :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php diff --git a/Documentation/Ctrl/Properties/FormattedLabelUserFunc.rst b/Documentation/Ctrl/Properties/FormattedLabelUserFunc.rst deleted file mode 100644 index e2963a49..00000000 --- a/Documentation/Ctrl/Properties/FormattedLabelUserFunc.rst +++ /dev/null @@ -1,59 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-formattedlabel-userfunc: - -======================== -formattedLabel\_userFunc -======================== - -.. confval:: formattedLabel_userFunc - :name: ctrl-formattedlabel-userfunc - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: string - :Scope: Display - - Similar to :ref:`label_userFunc ` but allows - to return formatted HTML for the label **and is used only for the labels of - inline (IRRE) records**. The referenced user function may receive optional - arguments using the :ref:`formattedLabel_userFunc_options - ` property. - - .. tip:: - - Read more about :ref:`Inline Relational Record Editing (IRRE) - `. - -Examples -======== - -.. todo: Use a new example, see https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-TCA/issues/727 - -.. note:: - This example is outdated: the :php:`UserFileInlineLabelService` class has - been deprecated with TYPO3 v12.0 and removed with TYPO3 v13.0. - -* Example from table "sys_file_reference":: - - 'formattedLabel_userFunc' => TYPO3\CMS\Core\Resource\Service\UserFileInlineLabelService::class . '->getInlineLabel', - 'formattedLabel_userFunc_options' => [ - 'sys_file' => [ - 'title', - 'name' - ] - ], - -In this example, :php:`getInlineLabel` will be called with an array of :php:`$parameters` which is passed by reference. -This array consists of the following keys (and values): - -* `table`: The table name of the current record -* `row`: The database row of the current record -* `isOnSymmetricSide`: True if we are looking from the symmetric ("other") side *to* the relation -* `options`: The options configured in TCA - see :ref:`formattedLabel_userFunc_options ` -* `parent`: Contains another array with the keys `uid` (referencing the inline child's parent uid) and `config` (referencing the parent configuration) -* `title`: Initialized to an empty string, this is the title that is manipulated by the user function - -The resulting title must be written to :php:`$parameters['title']`. - -.. seealso:: - - See class :php:`TYPO3\CMS\Core\Resource\Service\UserFileInlineLabelService` - for how such a user function should be designed and how the options are used. diff --git a/Documentation/Ctrl/Properties/FormattedLabelUserFuncOptions.rst b/Documentation/Ctrl/Properties/FormattedLabelUserFuncOptions.rst deleted file mode 100644 index e634ab0e..00000000 --- a/Documentation/Ctrl/Properties/FormattedLabelUserFuncOptions.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-formattedlabel-userfunc-options: - -================================= -formattedLabel\_userFunc\_options -================================= - -.. confval:: formattedLabel_userFunc_options - :name: ctrl-formattedlabel-userfunc-options - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: array - :Scope: Display - - - Options for :ref:`formattedLabel_userFunc `. - The array of options is passed to the user function in the parameters array - with key "options". diff --git a/Documentation/Ctrl/Properties/HideAtCopy.rst b/Documentation/Ctrl/Properties/HideAtCopy.rst deleted file mode 100644 index c970d39c..00000000 --- a/Documentation/Ctrl/Properties/HideAtCopy.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-hideatcopy: - -========== -hideAtCopy -========== - -.. confval:: hideAtCopy - :name: ctrl-hideAtCopy - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: boolean - :Scope: Proc. - - - If set, and the "disabled" field from :ref:`enablecolumns ` is - specified, then records will be disabled/hidden when they are copied. - - .. seealso:: - It is possible to disable this feature on a page and user or group level using the Page - TSconfig option :ref:`disableHideAtCopy `. diff --git a/Documentation/Ctrl/Properties/HideTable.rst b/Documentation/Ctrl/Properties/HideTable.rst deleted file mode 100644 index 112689da..00000000 --- a/Documentation/Ctrl/Properties/HideTable.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-hidetable: - -========= -hideTable -========= - -.. confval:: hideTable - :name: ctrl-hideTable - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: boolean - :Scope: Display - - - Hide this table in record listings, especially the list module. diff --git a/Documentation/Ctrl/Properties/Iconfile.rst b/Documentation/Ctrl/Properties/Iconfile.rst deleted file mode 100644 index 8af5941c..00000000 --- a/Documentation/Ctrl/Properties/Iconfile.rst +++ /dev/null @@ -1,26 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-iconfile: - -======== -iconfile -======== - -.. confval:: iconfile - :name: ctrl-iconfile - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: string - :Scope: Display - - - Pointing to the icon file to use for the table. Icons should be square SVGs. In case you cannot supply a SVG you - can still use a PNG file of 64x64 pixels in dimension. - -Examples -======== - -Example usage from the "examples" extension:: - - 'ctrl' => [ - 'iconfile' => 'EXT:examples/Resources/Public/Images/Haiku.svg', - ... - ], diff --git a/Documentation/Ctrl/Properties/Index.rst b/Documentation/Ctrl/Properties/Index.rst deleted file mode 100644 index 9fd18ce0..00000000 --- a/Documentation/Ctrl/Properties/Index.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference: - -========== -Properties -========== - -.. toctree:: - :glob: - - * diff --git a/Documentation/Ctrl/Properties/Label.rst b/Documentation/Ctrl/Properties/Label.rst deleted file mode 100644 index 726f3ada..00000000 --- a/Documentation/Ctrl/Properties/Label.rst +++ /dev/null @@ -1,35 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-label: - -===== -label -===== - -.. confval:: label - :name: ctrl-label - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: string (field name) - :Scope: Display - - - **Required!** - - Points to the field name of the table which should be used as the "title" - when the record is displayed in the system. - - .. note:: - :ref:`label_userFunc ` overrides this - property (but it is still required). - - .. warning:: - For the label only regular input or text fields should be used. Otherwise - issues may occur and prevent from a working system if - :typoscript:`TCEMAIN.table.tt_content.disablePrependAtCopy` is not set or - set to :typoscript:`0`. - -A simple example ----------------- - -.. include:: /Images/Rst/TxStyleguideCtrlMinimal.rst.txt - -.. include:: /CodeSnippets/TxStyleguideCtrlMinimal.rst.txt diff --git a/Documentation/Ctrl/Properties/LabelAlt.rst b/Documentation/Ctrl/Properties/LabelAlt.rst deleted file mode 100644 index cdebe48b..00000000 --- a/Documentation/Ctrl/Properties/LabelAlt.rst +++ /dev/null @@ -1,32 +0,0 @@ -.. include:: /Includes.rst.txt - -.. _ctrl-reference-label-alt: - -========== -label\_alt -========== - -.. confval:: label_alt - :name: ctrl-label-alt - :type: String (comma-separated list of field names) - :Scope: Display - - - Comma-separated list of field names, which are holding alternative - values to the value from the field pointed to by "label" (see above) - if that value is empty. May not be used consistently in the system, - but should apply in most cases. - - .. note:: - :ref:`label_userFunc ` overrides this property, also - see :ref:`label_alt_force `. - -Examples --------- - -Example for table "tt\_content":: - - 'ctrl' => [ - 'label' => 'header', - 'label_alt' => 'subheader,bodytext', - ], diff --git a/Documentation/Ctrl/Properties/LabelAltForce.rst b/Documentation/Ctrl/Properties/LabelAltForce.rst deleted file mode 100644 index 92d9d1da..00000000 --- a/Documentation/Ctrl/Properties/LabelAltForce.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. include:: /Includes.rst.txt - -.. _ctrl-reference-label-alt-force: - -================= -label\_alt\_force -================= - -.. confval:: label_alt_force - :name: ctrl-label-alt-force - :type: boolean - :Scope: Display - - If set, then the :ref:`label ` field and the - :ref:`label_alt ` fields - are shown in the title separated by comma. - - .. note:: - :ref:`label_userFunc ` overrides this - property. diff --git a/Documentation/Ctrl/Properties/LabelUserfunc.rst b/Documentation/Ctrl/Properties/LabelUserfunc.rst deleted file mode 100644 index 409e821b..00000000 --- a/Documentation/Ctrl/Properties/LabelUserfunc.rst +++ /dev/null @@ -1,72 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-label-userfunc: - -=============== -label\_userFunc -=============== - -.. confval:: label_userFunc - :name: ctrl-label-userFunc - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: string - :Scope: Display - - Function or method reference. This can be used whenever the label or - :ref:`label_alt ` options don't offer enough flexibility, e.g. when you want - to look up another table to create your label. The result of this - function overrules the :ref:`label `, :ref:`label_alt ` - and :ref:`label_alt_force ` settings. - - When calling a method from a class, enter :php:`[classname]->[methodname]`. The passed argument is an array - which contains the following information about the record for which to get the title:: - - $params['table'] = $table; - $params['row'] = $row; - - The resulting title must be written to $params['title'], which is passed by reference. - - .. warning:: - - The title is passed later on through :code:`htmlspecialchars()` - so it may not include any HTML formatting. - -Example -======= - -Let's look at what is done for the "haiku" table of the "examples" extension. The call to the user function appears -in the :file:`EXT:examples/Configuration/TCA/tx_examples_haiku.php` file:: - - 'ctrl' => [ - 'label' => 'title', - 'label_userFunc' => \Documentation\Examples\Userfuncs\Tca::class . '->haikuTitle', - ], - -Class :code:`Documentation\Examples\Userfuncs\Tca` contains the code itself:: - - public function haikuTitle(&$parameters) - { - $record = BackendUtility::getRecord($parameters['table'], $parameters['row']['uid']); - $newTitle = $record['title']; - $newTitle .= ' (' . substr(strip_tags($record['poem']), 0, 10) . '...)'; - $parameters['title'] = $newTitle; - } - - -.. _ctrl-reference-label-userfunc-options: - -label\_userFunc\_options -======================== - -.. confval:: label_userFunc_options - - :type: array - :Scope: Display - - - Options for :ref:`label_userFunc `. - The array of options is passed to the user function in the parameters array with key "options". - - .. note:: - When the :code:`label_userFunc` is used for inline (IRRE) - elements, the options are **not** passed. If you need options - use :ref:`formattedLabel_userFunc ` instead. diff --git a/Documentation/Ctrl/Properties/OrigUid.rst b/Documentation/Ctrl/Properties/OrigUid.rst deleted file mode 100644 index f74962f0..00000000 --- a/Documentation/Ctrl/Properties/OrigUid.rst +++ /dev/null @@ -1,35 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-origuid: - -======= -origUid -======= - -.. confval:: origUid - :name: ctrl-origUid - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: string (field name) - :Scope: Proc. - - - Field name, which will contain the UID of the original record in case a - record is created as a copy or new version of another record. - - Is used when new versions are created from elements and enables the backend - to display a visual comparison between a new version and its original. - - By convention the name :ref:`t3_origuid ` - is used for that field. - - .. note:: - The database field configured in this property is created automatically. - It does not have to be added to the :file:`ext_tables.sql`. - -Examples -======== - -The following fields are set by the DataHandler automatically on creating or -updating records, if they are configured in the :php:`ctrl` section of the TCA: - -.. literalinclude:: _CodeSnippets/_DataHandlerFields.php - :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php diff --git a/Documentation/Ctrl/Properties/ReadOnly.rst b/Documentation/Ctrl/Properties/ReadOnly.rst deleted file mode 100644 index ec22cd46..00000000 --- a/Documentation/Ctrl/Properties/ReadOnly.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-readonly: - -======== -readOnly -======== - -.. confval:: readOnly - :name: ctrl-readOnly - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: boolean - :Scope: Proc. / Display - - - Records from this table may not be edited in the TYPO3 backend. Such tables are usually called "static". - If set, this property is often combined with a :file:`ext_tables_static+adt.sql` file to automatically - populate the table with rows. diff --git a/Documentation/Ctrl/Properties/SearchFields.rst b/Documentation/Ctrl/Properties/SearchFields.rst deleted file mode 100644 index f3d55a49..00000000 --- a/Documentation/Ctrl/Properties/SearchFields.rst +++ /dev/null @@ -1,55 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-searchfields: - -============ -searchFields -============ - -.. confval:: searchFields - :name: ctrl-searchFields - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: string - :Scope: Search - - - Comma-separated list of fields from the table that will be included when searching for records in the TYPO3 backend. - No record from a table will ever be found if that table does not have `searchFields` defined. Only fields of the - following TCA types are searchable: - - * :ref:`input ` - * :ref:`text ` - * :ref:`flex ` - * :ref:`email ` - * :ref:`link ` - * :ref:`slug ` - * :ref:`color ` - * :ref:`json ` - * :ref:`uuid ` - - Adding fields of different types to `searchFields` has no effect. - - There are more fine grained controls per column, see the documentation of the "search" key of any - type in :ref:`columns-types`. - - .. note:: - - Fields of type :ref:`number ` or :ref:`datetime ` - may be excluded from search by default. To include them, modify the search query with this hook: - :doc:`ext_core:Changelog/9.2/Feature-71911-AddConstraintHookInDatabaseRecordListMakeSearchString`. - - - .. note:: - - When searching as admin the fields `uid` and `pid` are automatically included. - For editors, `uid` and/or `pid` have to be added manually to the searchFields list. - - -Examples -======== - -Example from "tt\_content" table:: - - 'ctrl' => [ - 'searchFields' => 'header,header_link,subheader,bodytext,pi_flexform', - ... - ], diff --git a/Documentation/Ctrl/Properties/Tstamp.rst b/Documentation/Ctrl/Properties/Tstamp.rst deleted file mode 100644 index a4e26946..00000000 --- a/Documentation/Ctrl/Properties/Tstamp.rst +++ /dev/null @@ -1,32 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-tstamp: - -====== -tstamp -====== - -.. confval:: tstamp - :name: ctrl-tstamp - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: string (field name) - :Scope: Proc. - - - Field name, which is automatically updated to the current timestamp - (UNIX-time in seconds) each time - the record is updated/saved in the system. - - By convention the name :ref:`tstamp ` is used for that field. - - .. note:: - The database field configured in this property is created automatically. - It does not have to be added to the :file:`ext_tables.sql`. - -Examples -======== - -The following fields are set by the DataHandler automatically on creating or -updating records, if they are configured in the :php:`ctrl` section of the TCA: - -.. literalinclude:: _CodeSnippets/_DataHandlerFields.php - :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php diff --git a/Documentation/Ctrl/Properties/TypeiconClasses.rst b/Documentation/Ctrl/Properties/TypeiconClasses.rst deleted file mode 100644 index b0a9a6f4..00000000 --- a/Documentation/Ctrl/Properties/TypeiconClasses.rst +++ /dev/null @@ -1,32 +0,0 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-typeicon-classes: - -================= -typeicon\_classes -================= - -.. confval:: typeicon_classes - :name: ctrl-typeicon-classes - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: array - :Scope: Display - - Array of icon identifiers to use for the records. The keys must correspond to the values found in the column - referenced in the :ref:`typeicon_column ` property. The values correspond - to icons registered in the :ref:`Icon API `. With the key `default`, a default icon is - defined, which is used when no matching key is found. The default icon is also used in the - "Create new record" dialog from the List module. For using and configuring `typeicon_classes` - for custom page types, please see :ref:`Create a new Page Type`. - - -Examples -======== - -Example from the `tt_content` table:: - - 'typeicon_classes' => [ - 'default' => 'mimetypes-x-content-text', - 'header' => 'mimetypes-x-content-header', - ... - ], - diff --git a/Documentation/Ctrl/Properties/_AutoCreateWarning.rst.txt b/Documentation/Ctrl/_CodeSnippets/_AutoCreatedColumns/_AutoCreateWarning.rst.txt similarity index 100% rename from Documentation/Ctrl/Properties/_AutoCreateWarning.rst.txt rename to Documentation/Ctrl/_CodeSnippets/_AutoCreatedColumns/_AutoCreateWarning.rst.txt diff --git a/Documentation/Ctrl/_AutoCreatedColumns/_OverrideHiddenDefault.php b/Documentation/Ctrl/_CodeSnippets/_AutoCreatedColumns/_OverrideHiddenDefault.php similarity index 100% rename from Documentation/Ctrl/_AutoCreatedColumns/_OverrideHiddenDefault.php rename to Documentation/Ctrl/_CodeSnippets/_AutoCreatedColumns/_OverrideHiddenDefault.php diff --git a/Documentation/Ctrl/_AutoCreatedColumns/_autoCreatePages.php b/Documentation/Ctrl/_CodeSnippets/_AutoCreatedColumns/_autoCreatePages.php similarity index 100% rename from Documentation/Ctrl/_AutoCreatedColumns/_autoCreatePages.php rename to Documentation/Ctrl/_CodeSnippets/_AutoCreatedColumns/_autoCreatePages.php diff --git a/Documentation/Ctrl/_AutoCreatedColumns/_pages.php b/Documentation/Ctrl/_CodeSnippets/_AutoCreatedColumns/_pages.php similarity index 100% rename from Documentation/Ctrl/_AutoCreatedColumns/_pages.php rename to Documentation/Ctrl/_CodeSnippets/_AutoCreatedColumns/_pages.php diff --git a/Documentation/Ctrl/Properties/_CodeSnippets/_DataHandlerFields.php b/Documentation/Ctrl/_CodeSnippets/_DataHandlerFields.php similarity index 100% rename from Documentation/Ctrl/Properties/_CodeSnippets/_DataHandlerFields.php rename to Documentation/Ctrl/_CodeSnippets/_DataHandlerFields.php diff --git a/Documentation/Ctrl/Properties/_CodeSnippets/_Delete.php b/Documentation/Ctrl/_CodeSnippets/_Delete.php similarity index 100% rename from Documentation/Ctrl/Properties/_CodeSnippets/_Delete.php rename to Documentation/Ctrl/_CodeSnippets/_Delete.php diff --git a/Documentation/Ctrl/Properties/_CodeSnippets/_Editlock.php b/Documentation/Ctrl/_CodeSnippets/_Editlock.php similarity index 100% rename from Documentation/Ctrl/Properties/_CodeSnippets/_Editlock.php rename to Documentation/Ctrl/_CodeSnippets/_Editlock.php diff --git a/Documentation/Ctrl/Properties/_CodeSnippets/_Enablecolumns.diff b/Documentation/Ctrl/_CodeSnippets/_Enablecolumns.diff similarity index 100% rename from Documentation/Ctrl/Properties/_CodeSnippets/_Enablecolumns.diff rename to Documentation/Ctrl/_CodeSnippets/_Enablecolumns.diff diff --git a/Documentation/Ctrl/Properties/_CodeSnippets/_Enablecolumns.php b/Documentation/Ctrl/_CodeSnippets/_Enablecolumns.php similarity index 100% rename from Documentation/Ctrl/Properties/_CodeSnippets/_Enablecolumns.php rename to Documentation/Ctrl/_CodeSnippets/_Enablecolumns.php diff --git a/Documentation/Ctrl/Properties/_CodeSnippets/_FeGroup.php b/Documentation/Ctrl/_CodeSnippets/_FeGroup.php similarity index 100% rename from Documentation/Ctrl/Properties/_CodeSnippets/_FeGroup.php rename to Documentation/Ctrl/_CodeSnippets/_FeGroup.php diff --git a/Documentation/Ctrl/Properties/_CodeSnippets/_Hidden.php b/Documentation/Ctrl/_CodeSnippets/_Hidden.php similarity index 100% rename from Documentation/Ctrl/Properties/_CodeSnippets/_Hidden.php rename to Documentation/Ctrl/_CodeSnippets/_Hidden.php diff --git a/Documentation/Ctrl/Properties/_CodeSnippets/_Language.diff b/Documentation/Ctrl/_CodeSnippets/_Language.diff similarity index 100% rename from Documentation/Ctrl/Properties/_CodeSnippets/_Language.diff rename to Documentation/Ctrl/_CodeSnippets/_Language.diff diff --git a/Documentation/Ctrl/Properties/_CodeSnippets/_Language.php b/Documentation/Ctrl/_CodeSnippets/_Language.php similarity index 100% rename from Documentation/Ctrl/Properties/_CodeSnippets/_Language.php rename to Documentation/Ctrl/_CodeSnippets/_Language.php diff --git a/Documentation/Ctrl/Properties/_CodeSnippets/_Sorting.php b/Documentation/Ctrl/_CodeSnippets/_Sorting.php similarity index 100% rename from Documentation/Ctrl/Properties/_CodeSnippets/_Sorting.php rename to Documentation/Ctrl/_CodeSnippets/_Sorting.php diff --git a/Documentation/Ctrl/Properties/_CodeSnippets/_StarttimeEndtime.php b/Documentation/Ctrl/_CodeSnippets/_StarttimeEndtime.php similarity index 100% rename from Documentation/Ctrl/Properties/_CodeSnippets/_StarttimeEndtime.php rename to Documentation/Ctrl/_CodeSnippets/_StarttimeEndtime.php diff --git a/Documentation/Ctrl/_CodeSnippets/_WizardRegistration/_ext_localconf.php b/Documentation/Ctrl/_CodeSnippets/_WizardRegistration/_ext_localconf.php new file mode 100644 index 00000000..676ebcd3 --- /dev/null +++ b/Documentation/Ctrl/_CodeSnippets/_WizardRegistration/_ext_localconf.php @@ -0,0 +1,13 @@ + 'ReferencesToThisRecordWizard', + 'priority' => 40, + 'class' => ReferencesToThisRecordWizard::class, +]; diff --git a/Documentation/Ctrl/_CodeSnippets/_WizardRegistration/_tca_overrides.php b/Documentation/Ctrl/_CodeSnippets/_WizardRegistration/_tca_overrides.php new file mode 100644 index 00000000..a0aa6aad --- /dev/null +++ b/Documentation/Ctrl/_CodeSnippets/_WizardRegistration/_tca_overrides.php @@ -0,0 +1,15 @@ + [ + 'fieldWizard' => [ + 'ReferencesToThisRecordWizard' => [ + 'renderType' => 'ReferencesToThisRecordWizard', + ], + ], + ], +]; diff --git a/Documentation/Ctrl/_CodeSnippets/_disableFieldWizard.php b/Documentation/Ctrl/_CodeSnippets/_disableFieldWizard.php new file mode 100644 index 00000000..8d825175 --- /dev/null +++ b/Documentation/Ctrl/_CodeSnippets/_disableFieldWizard.php @@ -0,0 +1,17 @@ + [ + // ... + 'container' => [ + 'inlineControlContainer' => [ + 'fieldWizard' => [ + 'localizationStateSelector' => [ + 'disabled' => true, + ], + ], + ], + ], + ], + // ... +]; diff --git a/Documentation/Ctrl/_Properties/_AdminOnly.rst.txt b/Documentation/Ctrl/_Properties/_AdminOnly.rst.txt new file mode 100644 index 00000000..ceabe7dd --- /dev/null +++ b/Documentation/Ctrl/_Properties/_AdminOnly.rst.txt @@ -0,0 +1,19 @@ +.. _ctrl-reference-adminonly: + +.. confval:: adminOnly + :name: ctrl-adminOnly + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: boolean + :Scope: Proc. / Display + + Records can be changed *only* by "admin"-users (having the "admin" flag set). + + .. rubric:: Example: Table :sql:`my_table` is only editable by admin users: + + .. code-block:: php + :caption: EXT:my_sitepackage/Configuration/TCA/my_table.php + + 'ctrl' => [ + 'adminOnly' => 1, + ... + ], diff --git a/Documentation/Ctrl/_Properties/_Container.rst.txt b/Documentation/Ctrl/_Properties/_Container.rst.txt new file mode 100644 index 00000000..f95e58f1 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_Container.rst.txt @@ -0,0 +1,67 @@ +.. _ctrl-reference-container: + +.. confval:: container + :name: ctrl-container + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: array + :Scope: Display + :Examples: :ref:`tca_example_ctrl_container` + + Array to configure additional items in render containers of :ref:`FormEngine `, + see section :ref:`Node expansion `. + + Next to single elements, some render container allow to be "enriched" with additional information via + the "node expansion" API. Currently, the :php:`OuterWrapContainer` implements :php:`fieldWizard` and + :php:`fieldInformation`. :php:`InlineControlContainer` implements :php:`fieldWizard` and comes with + the default wizard :php:`localizationStateSelector`. Custom containers may implement expansion nodes, too, + and if implemented correctly will automatically have their configuration merged with the definition + provided in this TCA array. + + The basic array looks like:: + + 'ctrl' => [ + 'container' => [ + '' => [ + 'fieldWizard' => [ + '' => [ + 'renderType' => '', + 'before' => [''], + 'after' => [''], + 'disabled' => false, + 'options' => [], + ], + ], + ], + ], + ], + + + should be a defined container render type. + You can find more about the :code:`outerWrapContainer` and + :code:`inlineControlContainer` in the FormEngine documentation section on + :ref:`rendering `. + Valid types are for example: + + - :code:`outerWrapContainer` type which corresponds to the + :php:`OuterWrapContainer` (class). + - :code:`inlineControlContainer` type which corresponds to the + :php:`InlineControlContainer` class + - :code:`inline` type which corresponds to the :php:`InlineControlContainer` + class. + + renderType + refers to a registered node name from :php:`NodeFactory` + + before, after + can be set to sort single wizards relative to each other. + + disabled + can be used to disable built in default wizards. + + options + Some wizards may support additional "options". + + Note, next to "fieldWizard", some containers may also implement "fieldInformation", which can be + manipulated the same way. + + See also :ref:`tca_example_ctrl_container`. diff --git a/Documentation/Ctrl/_Properties/_CopyAfterDuplFields.rst.txt b/Documentation/Ctrl/_Properties/_CopyAfterDuplFields.rst.txt new file mode 100644 index 00000000..b20ec681 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_CopyAfterDuplFields.rst.txt @@ -0,0 +1,18 @@ +.. _ctrl-reference-copyafterduplfields: + +.. confval:: copyAfterDuplFields + :name: ctrl-copyAfterDuplFields + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: string (list of field names) + :Scope: Proc. + + The fields in this list will automatically have the value of the same field + from the "previous" record transferred when they are *copied* to the + position *after* another record from same table. + + .. rubric:: Example from `tt_content` table:: + + 'ctrl' => [ + 'copyAfterDuplFields' => 'colPos, sys_language_uid', + ... + ], diff --git a/Documentation/Ctrl/_Properties/_Crdate.rst.txt b/Documentation/Ctrl/_Properties/_Crdate.rst.txt new file mode 100644 index 00000000..278ba107 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_Crdate.rst.txt @@ -0,0 +1,24 @@ +.. _ctrl-reference-crdate: + +.. confval:: crdate + :name: ctrl-crdate + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: string (field name) + :Scope: Proc. + + Field name, which is automatically set to the current timestamp when + the record is created. Is never modified again. + + By convention the name :ref:`crdate ` is used for that field. + + .. note:: + The database field configured in this property is created automatically. + It does not have to be added to the :file:`ext_tables.sql`. + + .. rubric:: Example + + The following fields are set by the DataHandler automatically on creating or + updating records, if they are configured in the :php:`ctrl` section of the TCA: + + .. literalinclude:: _CodeSnippets/_DataHandlerFields.php + :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php diff --git a/Documentation/Ctrl/_Properties/_DefaultSortby.rst.txt b/Documentation/Ctrl/_Properties/_DefaultSortby.rst.txt new file mode 100644 index 00000000..aafc671f --- /dev/null +++ b/Documentation/Ctrl/_Properties/_DefaultSortby.rst.txt @@ -0,0 +1,39 @@ +.. _ctrl-reference-default-sortby: + +.. confval:: default_sortby + :name: ctrl-default-sortby + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: string + :Scope: Display + + + If a field name for :ref:`sortby ` is defined, then this is ignored. + + Otherwise this is used as the 'ORDER BY' statement to sort the records in the table when listed in the TYPO3 backend. + It is possible to have multiple field names in here, and each can have an ASC or DESC keyword. Note that the value + *should not* be prefixed with 'ORDER BY' in itself. + + .. rubric:: Example: Sort by title + + .. code-block:: php + + 'ctrl' => [ + 'default_sortby' => 'title', + ... + ], + + .. rubric:: Example: by title and then by creation date + + .. code-block:: php + + 'ctrl' => [ + 'default_sortby' => 'title ASC, crdate DESC', + ... + ], + + .. warning:: + Do not confuse this property with :ref:`sortby `: default_sortby should be set only if there + is no :ref:`sortby `. The sortby field (typically set to `sorting`) contains an integer + for explicit sorting , the backend then shows "up" and "down" buttons to manage sorting of records relative + to each other. The default\_sortby should only be set if that explicit sorting is not wanted or useful. For + instance, the list of frontend users is sorted by username and has no other explicit sorting field in the database. diff --git a/Documentation/Ctrl/_Properties/_Delete.rst.txt b/Documentation/Ctrl/_Properties/_Delete.rst.txt new file mode 100644 index 00000000..40560b20 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_Delete.rst.txt @@ -0,0 +1,22 @@ +.. _ctrl-reference-delete: + +.. confval:: delete + :name: ctrl-delete + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: string (field name) + :Scope: Proc. / Display + + + Field name, which indicates if a record is considered deleted or not. + + If this "soft delete" feature is used, then records are not really deleted, but just marked as 'deleted' by setting + the value of the field name to "1". In turn, the whole system *must* strictly respect the record as deleted. This + means that any SQL query must exclude records where this field is true. + + This is a very common feature. Most tables use it throughout the TYPO3 Core. The core extension "recycler" + can be used to "revive" those deleted records again. + + .. rubric:: Example: Enable soft delete for the following table + + .. literalinclude:: _CodeSnippets/_Delete.php + caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php diff --git a/Documentation/Ctrl/Properties/DescriptionColumn.rst b/Documentation/Ctrl/_Properties/_DescriptionColumn.rst.txt similarity index 69% rename from Documentation/Ctrl/Properties/DescriptionColumn.rst rename to Documentation/Ctrl/_Properties/_DescriptionColumn.rst.txt index f62cb861..c1423871 100644 --- a/Documentation/Ctrl/Properties/DescriptionColumn.rst +++ b/Documentation/Ctrl/_Properties/_DescriptionColumn.rst.txt @@ -1,10 +1,5 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-descriptionColumn: -================= -descriptionColumn -================= - .. confval:: descriptionColumn :name: ctrl-descriptionColumn :Path: $GLOBALS['TCA'][$table]['ctrl'] @@ -22,13 +17,12 @@ descriptionColumn additional information on single records. The TYPO3 Core sets this property for a series of main tables like `be_users`, `be_groups` and `tt_content`. - .. include:: _AutoCreateWarning.rst.txt + .. include:: /Ctrl/_CodeSnippets/_AutoCreatedColumns/_AutoCreateWarning.rst.txt -.. _ctrl-reference-descriptionColumn-example: + .. _ctrl-reference-descriptionColumn-example: -Example: Create a table that has a description column -===================================================== + .. rubric:: Example: Create a table that has a description column -.. include:: /Images/Rst/CtrlDescriptionColumn.rst.txt + .. include:: /Images/Rst/CtrlDescriptionColumn.rst.txt -.. include:: /CodeSnippets/TxStyleguideCtrlCommon.rst.txt + .. include:: /CodeSnippets/TxStyleguideCtrlCommon.rst.txt diff --git a/Documentation/Ctrl/Properties/Editlock.rst b/Documentation/Ctrl/_Properties/_Editlock.rst.txt similarity index 73% rename from Documentation/Ctrl/Properties/Editlock.rst rename to Documentation/Ctrl/_Properties/_Editlock.rst.txt index b26fad82..fde3b9ee 100644 --- a/Documentation/Ctrl/Properties/Editlock.rst +++ b/Documentation/Ctrl/_Properties/_Editlock.rst.txt @@ -1,10 +1,5 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-editlock: -======== -editlock -======== - .. confval:: editlock :name: ctrl-editlock :Path: $GLOBALS['TCA'][$table]['ctrl'] @@ -25,13 +20,12 @@ editlock This feature is used on the pages table, where it also prevents editing of records on that page (except other pages)! Also, no new records (including pages) can be created on the page. - .. include:: _AutoCreateWarning.rst.txt + .. include:: /Ctrl/_CodeSnippets/_AutoCreatedColumns/_AutoCreateWarning.rst.txt -.. _ctrl-reference-editlock-example: + .. _ctrl-reference-editlock-example: -Example: A table with editlock -============================== + .. rubric:: Example: A table with editlock -If the checkbox is set, the affected record can only be edited by admins. + If the checkbox is set, the affected record can only be edited by admins. -.. literalinclude:: _CodeSnippets/_Editlock.php + .. literalinclude:: _CodeSnippets/_Editlock.php diff --git a/Documentation/Ctrl/_Properties/_Enablecolumns.rst.txt b/Documentation/Ctrl/_Properties/_Enablecolumns.rst.txt new file mode 100644 index 00000000..3c986515 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_Enablecolumns.rst.txt @@ -0,0 +1,44 @@ +.. _ctrl-reference-enablecolumns: + +.. confval:: enablecolumns + :name: ctrl-enablecolumns + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: array + :Scope: Proc. / Display + + .. versionchanged:: 13.3 + The column definitions for these settings are :ref:`auto-created `. + + 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 + :ref:`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: + + `disabled` + Defines which field serves as hidden/disabled flag. + + `starttime` + Defines which field contains the starting time. + + `endtime` + Defines which field contains the ending time. + + `fe_group` + Defines which field is used for access control via a selection of FE user groups. + + .. note:: + 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: + + .. include:: /Images/Rst/CtrlEnableFields.rst.txt + + .. include:: /Ctrl/_CodeSnippets/_AutoCreatedColumns/_AutoCreateWarning.rst.txt + + See also the :ref:`delete ` and + :ref:`ctrl-reference-editlock` features which are related, + but are active for both frontend and backend. diff --git a/Documentation/Ctrl/Properties/Ext.rst b/Documentation/Ctrl/_Properties/_Ext.rst.txt similarity index 84% rename from Documentation/Ctrl/Properties/Ext.rst rename to Documentation/Ctrl/_Properties/_Ext.rst.txt index cc50ac01..d611e677 100644 --- a/Documentation/Ctrl/Properties/Ext.rst +++ b/Documentation/Ctrl/_Properties/_Ext.rst.txt @@ -1,9 +1,4 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-ext-extension-key: - -=== -EXT -=== +.. _ctrl-reference-ext-extension-key: .. confval:: EXT :name: ctrl-ext @@ -16,7 +11,7 @@ EXT Let's say that you have an extension with the key "myext", then it is ok to define properties for: - .. code-block:: php + .. code-block:: php ['ctrl']['EXT']['myext'] = ... (whatever you define) diff --git a/Documentation/Ctrl/_Properties/_FormattedLabelUserFunc.rst.txt b/Documentation/Ctrl/_Properties/_FormattedLabelUserFunc.rst.txt new file mode 100644 index 00000000..a70a692e --- /dev/null +++ b/Documentation/Ctrl/_Properties/_FormattedLabelUserFunc.rst.txt @@ -0,0 +1,18 @@ +.. _ctrl-reference-formattedlabel-userfunc: + +.. confval:: formattedLabel_userFunc + :name: ctrl-formattedlabel-userfunc + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: string + :Scope: Display + + Similar to :ref:`label_userFunc ` but allows + to return formatted HTML for the label **and is used only for the labels of + inline (IRRE) records**. The referenced user function may receive optional + arguments using the :ref:`formattedLabel_userFunc_options + ` property. + + .. tip:: + + Read more about :ref:`Inline Relational Record Editing (IRRE) + `. diff --git a/Documentation/Ctrl/_Properties/_FormattedLabelUserFuncOptions.rst.txt b/Documentation/Ctrl/_Properties/_FormattedLabelUserFuncOptions.rst.txt new file mode 100644 index 00000000..515a0ad9 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_FormattedLabelUserFuncOptions.rst.txt @@ -0,0 +1,12 @@ +.. _ctrl-reference-formattedlabel-userfunc-options: + +.. confval:: formattedLabel_userFunc_options + :name: ctrl-formattedlabel-userfunc-options + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: array + :Scope: Display + + + Options for :ref:`formattedLabel_userFunc `. + The array of options is passed to the user function in the parameters array + with key "options". diff --git a/Documentation/Ctrl/Properties/GroupName.rst b/Documentation/Ctrl/_Properties/_GroupName.rst.txt similarity index 95% rename from Documentation/Ctrl/Properties/GroupName.rst rename to Documentation/Ctrl/_Properties/_GroupName.rst.txt index 1ac80a4a..12a1f71d 100644 --- a/Documentation/Ctrl/Properties/GroupName.rst +++ b/Documentation/Ctrl/_Properties/_GroupName.rst.txt @@ -1,10 +1,5 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-groupname: -========= -groupName -========= - .. confval:: groupName :name: ctrl-groupName :Path: $GLOBALS['TCA'][$table]['ctrl'] diff --git a/Documentation/Ctrl/_Properties/_HideAtCopy.rst.txt b/Documentation/Ctrl/_Properties/_HideAtCopy.rst.txt new file mode 100644 index 00000000..ceb9b90c --- /dev/null +++ b/Documentation/Ctrl/_Properties/_HideAtCopy.rst.txt @@ -0,0 +1,15 @@ +.. _ctrl-reference-hideatcopy: + +.. confval:: hideAtCopy + :name: ctrl-hideAtCopy + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: boolean + :Scope: Proc. + + + If set, and the "disabled" field from :ref:`enablecolumns ` is + specified, then records will be disabled/hidden when they are copied. + + .. seealso:: + It is possible to disable this feature on a page and user or group level using the Page + TSconfig option :ref:`disableHideAtCopy `. diff --git a/Documentation/Ctrl/_Properties/_HideTable.rst.txt b/Documentation/Ctrl/_Properties/_HideTable.rst.txt new file mode 100644 index 00000000..0bee318e --- /dev/null +++ b/Documentation/Ctrl/_Properties/_HideTable.rst.txt @@ -0,0 +1,10 @@ +.. _ctrl-reference-hidetable: + +.. confval:: hideTable + :name: ctrl-hideTable + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: boolean + :Scope: Display + + + Hide this table in record listings, especially the list module. diff --git a/Documentation/Ctrl/_Properties/_Iconfile.rst.txt b/Documentation/Ctrl/_Properties/_Iconfile.rst.txt new file mode 100644 index 00000000..22c01b40 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_Iconfile.rst.txt @@ -0,0 +1,20 @@ +.. _ctrl-reference-iconfile: + +.. confval:: iconfile + :name: ctrl-iconfile + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: string + :Scope: Display + + + Pointing to the icon file to use for the table. Icons should be square SVGs. In case you cannot supply a SVG you + can still use a PNG file of 64x64 pixels in dimension. + +.. rubric:: Example usage from the "examples" extension + +.. code-block:: php + + 'ctrl' => [ + 'iconfile' => 'EXT:examples/Resources/Public/Images/Haiku.svg', + ... + ], diff --git a/Documentation/Ctrl/Properties/IsStatic.rst b/Documentation/Ctrl/_Properties/_IsStatic.rst.txt similarity index 65% rename from Documentation/Ctrl/Properties/IsStatic.rst rename to Documentation/Ctrl/_Properties/_IsStatic.rst.txt index beba7a41..b6574c85 100644 --- a/Documentation/Ctrl/Properties/IsStatic.rst +++ b/Documentation/Ctrl/_Properties/_IsStatic.rst.txt @@ -1,16 +1,10 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-is-static: - -========== -is\_static -========== - -.. confval:: is_static - :name: ctrl-is-static - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: boolean - :Scope: Used by import/export +.. _ctrl-reference-is-static: +.. confval:: is_static + :name: ctrl-is-static + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: boolean + :Scope: Used by import/export This marks a table to be "static". diff --git a/Documentation/Ctrl/_Properties/_Label.rst.txt b/Documentation/Ctrl/_Properties/_Label.rst.txt new file mode 100644 index 00000000..2961eaa9 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_Label.rst.txt @@ -0,0 +1,28 @@ +.. _ctrl-reference-label: + +.. confval:: label + :name: ctrl-label + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: string (field name) + :Scope: Display + + **Required!** + + Points to the field name of the table which should be used as the "title" + when the record is displayed in the system. + + .. note:: + :ref:`label_userFunc ` overrides this + property (but it is still required). + + .. warning:: + For the label only regular input or text fields should be used. Otherwise + issues may occur and prevent from a working system if + :typoscript:`TCEMAIN.table.tt_content.disablePrependAtCopy` is not set or + set to :typoscript:`0`. + + .. rubric:: A simple example + + .. include:: /Images/Rst/TxStyleguideCtrlMinimal.rst.txt + + .. include:: /CodeSnippets/TxStyleguideCtrlMinimal.rst.txt diff --git a/Documentation/Ctrl/_Properties/_LabelAlt.rst.txt b/Documentation/Ctrl/_Properties/_LabelAlt.rst.txt new file mode 100644 index 00000000..2f3fb565 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_LabelAlt.rst.txt @@ -0,0 +1,26 @@ + +.. _ctrl-reference-label-alt: + +.. confval:: label_alt + :name: ctrl-label-alt + :type: String (comma-separated list of field names) + :Scope: Display + + + Comma-separated list of field names, which are holding alternative + values to the value from the field pointed to by "label" (see above) + if that value is empty. May not be used consistently in the system, + but should apply in most cases. + + .. note:: + :ref:`label_userFunc ` overrides this property, also + see :ref:`label_alt_force `. + +.. rubric:: Example for table `tt_content` + +.. code-block:: php + + 'ctrl' => [ + 'label' => 'header', + 'label_alt' => 'subheader,bodytext', + ], diff --git a/Documentation/Ctrl/_Properties/_LabelAltForce.rst.txt b/Documentation/Ctrl/_Properties/_LabelAltForce.rst.txt new file mode 100644 index 00000000..42180064 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_LabelAltForce.rst.txt @@ -0,0 +1,15 @@ + +.. _ctrl-reference-label-alt-force: + +.. confval:: label_alt_force + :name: ctrl-label-alt-force + :type: boolean + :Scope: Display + + If set, then the :ref:`label ` field and the + :ref:`label_alt ` fields + are shown in the title separated by comma. + + .. note:: + :ref:`label_userFunc ` overrides this + property. diff --git a/Documentation/Ctrl/_Properties/_LabelUserfunc.rst.txt b/Documentation/Ctrl/_Properties/_LabelUserfunc.rst.txt new file mode 100644 index 00000000..c2395650 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_LabelUserfunc.rst.txt @@ -0,0 +1,61 @@ +.. _ctrl-reference-label-userfunc: + +.. confval:: label_userFunc + :name: ctrl-label-userFunc + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: string + :Scope: Display + + Function or method reference. This can be used whenever the label or + :ref:`label_alt ` options don't offer enough flexibility, e.g. when you want + to look up another table to create your label. The result of this + function overrules the :ref:`label `, :ref:`label_alt ` + and :ref:`label_alt_force ` settings. + + When calling a method from a class, enter :php:`[classname]->[methodname]`. The passed argument is an array + which contains the following information about the record for which to get the title:: + + $params['table'] = $table; + $params['row'] = $row; + + The resulting title must be written to $params['title'], which is passed by reference. + + .. warning:: + + The title is passed later on through :code:`htmlspecialchars()` + so it may not include any HTML formatting. + + .. rubric:: Example + + Let's look at what is done for the "haiku" table of the "examples" extension. The call to the user function appears + in the :file:`EXT:examples/Configuration/TCA/tx_examples_haiku.php` file:: + + 'ctrl' => [ + 'label' => 'title', + 'label_userFunc' => \Documentation\Examples\Userfuncs\Tca::class . '->haikuTitle', + ], + + Class :code:`Documentation\Examples\Userfuncs\Tca` contains the code itself:: + + public function haikuTitle(&$parameters) + { + $record = BackendUtility::getRecord($parameters['table'], $parameters['row']['uid']); + $newTitle = $record['title']; + $newTitle .= ' (' . substr(strip_tags($record['poem']), 0, 10) . '...)'; + $parameters['title'] = $newTitle; + } + +.. _ctrl-reference-label-userfunc-options: + +.. confval:: label_userFunc_options + :name: ctrl-label-userFunc-options + :type: array + :Scope: Display + + Options for :ref:`label_userFunc `. + The array of options is passed to the user function in the parameters array with key "options". + + .. note:: + When the :code:`label_userFunc` is used for inline (IRRE) + elements, the options are **not** passed. If you need options + use :ref:`formattedLabel_userFunc ` instead. diff --git a/Documentation/Ctrl/Properties/LanguageField.rst b/Documentation/Ctrl/_Properties/_LanguageField.rst.txt similarity index 80% rename from Documentation/Ctrl/Properties/LanguageField.rst rename to Documentation/Ctrl/_Properties/_LanguageField.rst.txt index c65ce924..69ee8fd8 100644 --- a/Documentation/Ctrl/Properties/LanguageField.rst +++ b/Documentation/Ctrl/_Properties/_LanguageField.rst.txt @@ -1,10 +1,5 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-languagefield: -============= -languageField -============= - .. confval:: languageField :name: ctrl-languageField :Path: $GLOBALS['TCA'][$table]['ctrl'] @@ -29,27 +24,25 @@ languageField for a discussion about the effects of this property (and other TCA properties) on the localization process. - .. include:: _AutoCreateWarning.rst.txt + .. include:: /Ctrl/_CodeSnippets/_AutoCreatedColumns/_AutoCreateWarning.rst.txt .. _ctrl-reference-languagefield-migration: -Migration: Remove language column definitions from TCA -====================================================== +.. rubric:: Migration: Remove language column definitions from TCA On dropping TYPO3 v12.4 support extensions authors can drop the column definitions of the language fields. They need to keep the :ref:`palettes` and -:ref:`type` definitions, however: +:ref:`types` definitions, however: .. literalinclude:: _CodeSnippets/_Language.diff :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php .. _ctrl-reference-languagefield-example: -Example: A table with localization support -========================================== +.. rubric:: Example: A table with localization support -.. include:: /Images/Rst/SysLanguageUid.rst.txt +.. include:: /Images/Rst/SysLanguageUid.rst.txt .. literalinclude:: _CodeSnippets/_Language.php :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php diff --git a/Documentation/Ctrl/_Properties/_OrigUid.rst.txt b/Documentation/Ctrl/_Properties/_OrigUid.rst.txt new file mode 100644 index 00000000..b0581bdc --- /dev/null +++ b/Documentation/Ctrl/_Properties/_OrigUid.rst.txt @@ -0,0 +1,28 @@ +.. _ctrl-reference-origuid: + +.. confval:: origUid + :name: ctrl-origUid + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: string (field name) + :Scope: Proc. + + Field name, which will contain the UID of the original record in case a + record is created as a copy or new version of another record. + + Is used when new versions are created from elements and enables the backend + to display a visual comparison between a new version and its original. + + By convention the name :ref:`t3_origuid ` + is used for that field. + + .. note:: + The database field configured in this property is created automatically. + It does not have to be added to the :file:`ext_tables.sql`. + + .. rubric:: Example + + The following fields are set by the DataHandler automatically on creating or + updating records, if they are configured in the :php:`ctrl` section of the TCA: + + .. literalinclude:: _CodeSnippets/_DataHandlerFields.php + :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php diff --git a/Documentation/Ctrl/Properties/PrependAtCopy.rst b/Documentation/Ctrl/_Properties/_PrependAtCopy.rst.txt similarity index 91% rename from Documentation/Ctrl/Properties/PrependAtCopy.rst rename to Documentation/Ctrl/_Properties/_PrependAtCopy.rst.txt index 7bcbe345..9962d57d 100644 --- a/Documentation/Ctrl/Properties/PrependAtCopy.rst +++ b/Documentation/Ctrl/_Properties/_PrependAtCopy.rst.txt @@ -1,10 +1,5 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-prependatcopy: -============= -prependAtCopy -============= - .. confval:: prependAtCopy :name: ctrl-prependAtCopy :Path: $GLOBALS['TCA'][$table]['ctrl'] diff --git a/Documentation/Ctrl/_Properties/_PreviewRenderer.rst.txt b/Documentation/Ctrl/_Properties/_PreviewRenderer.rst.txt new file mode 100644 index 00000000..172900dd --- /dev/null +++ b/Documentation/Ctrl/_Properties/_PreviewRenderer.rst.txt @@ -0,0 +1,24 @@ +.. _ctrl-reference-previewrenderer: + +.. confval:: previewRenderer + :name: ctrl-previewRenderer + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: string + :Scope: Display + + Configures a backend preview for a content element. + + Have also a look at :ref:`t3coreapi:ConfigureCE-Preview` for more details. + + Use :confval:`property previewRenderer of section types ` + to configure the preview for a certain type or subtype only. + + .. rubric:: Example: Use for any record in a table + + This specifies the preview renderer to be used for any record in + :sql:`tx_myextension_domain_model_mytable`: + + .. code-block:: php + + $GLOBALS['TCA']['tx_myextension_domain_model_mytable']['ctrl']['previewRenderer'] + = \MyVendor\MyExtension\Preview\PreviewRenderer::class; diff --git a/Documentation/Ctrl/_Properties/_ReadOnly.rst.txt b/Documentation/Ctrl/_Properties/_ReadOnly.rst.txt new file mode 100644 index 00000000..608e9efa --- /dev/null +++ b/Documentation/Ctrl/_Properties/_ReadOnly.rst.txt @@ -0,0 +1,11 @@ +.. _ctrl-reference-readonly: + +.. confval:: readOnly + :name: ctrl-readOnly + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: boolean + :Scope: Proc. / Display + + Records from this table may not be edited in the TYPO3 backend. Such tables are usually called "static". + If set, this property is often combined with a :file:`ext_tables_static+adt.sql` file to automatically + populate the table with rows. diff --git a/Documentation/Ctrl/Properties/RootLevel.rst b/Documentation/Ctrl/_Properties/_RootLevel.rst.txt similarity index 95% rename from Documentation/Ctrl/Properties/RootLevel.rst rename to Documentation/Ctrl/_Properties/_RootLevel.rst.txt index a5422a33..5500fc2b 100644 --- a/Documentation/Ctrl/Properties/RootLevel.rst +++ b/Documentation/Ctrl/_Properties/_RootLevel.rst.txt @@ -1,12 +1,7 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-rootlevel: -========= -rootLevel -========= - .. confval:: rootLevel - :name: ctrl-rootLevel + :name: ctrl-rootLevel :Path: $GLOBALS['TCA'][$table]['ctrl'] :type: [0, 1, -1] :Scope: Proc. / Display diff --git a/Documentation/Ctrl/_Properties/_SearchFields.rst.txt b/Documentation/Ctrl/_Properties/_SearchFields.rst.txt new file mode 100644 index 00000000..f2f2eaa0 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_SearchFields.rst.txt @@ -0,0 +1,48 @@ +.. _ctrl-reference-searchfields: + +.. confval:: searchFields + :name: ctrl-searchFields + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: string + :Scope: Search + + + Comma-separated list of fields from the table that will be included when searching for records in the TYPO3 backend. + No record from a table will ever be found if that table does not have `searchFields` defined. Only fields of the + following TCA types are searchable: + + * :ref:`input ` + * :ref:`text ` + * :ref:`flex ` + * :ref:`email ` + * :ref:`link ` + * :ref:`slug ` + * :ref:`color ` + * :ref:`json ` + * :ref:`uuid ` + + Adding fields of different types to `searchFields` has no effect. + + There are more fine grained controls per column, see the documentation of the "search" key of any + type in :ref:`columns-types`. + + .. note:: + + Fields of type :ref:`number ` or :ref:`datetime ` + may be excluded from search by default. To include them, modify the search query with this hook: + :doc:`ext_core:Changelog/9.2/Feature-71911-AddConstraintHookInDatabaseRecordListMakeSearchString`. + + + .. note:: + + When searching as admin the fields `uid` and `pid` are automatically included. + For editors, `uid` and/or `pid` have to be added manually to the searchFields list. + + .. rubric:: Example from "tt\_content" table + + .. code-block:: php + + 'ctrl' => [ + 'searchFields' => 'header,header_link,subheader,bodytext,pi_flexform', + ... + ], diff --git a/Documentation/Ctrl/Properties/Security.rst b/Documentation/Ctrl/_Properties/_Security.rst.txt similarity index 97% rename from Documentation/Ctrl/Properties/Security.rst rename to Documentation/Ctrl/_Properties/_Security.rst.txt index b1b27164..5b3b9501 100644 --- a/Documentation/Ctrl/Properties/Security.rst +++ b/Documentation/Ctrl/_Properties/_Security.rst.txt @@ -1,21 +1,15 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-security: .. _ctrl-security: .. _ctrl-security-ignorewebmountrestriction: .. _ctrl-security-ignorerootlevelrestriction: .. _ctrl-security-ignorePageTypeRestriction: -======== -security -======== - .. confval:: security :name: ctrl-security :Path: $GLOBALS['TCA'][$table]['ctrl'] :type: array :Scope: Display - Array of sub-properties. This is used, for example, in the Core for the :sql:`sys_file` table: diff --git a/Documentation/Ctrl/Properties/SeliconField.rst b/Documentation/Ctrl/_Properties/_SeliconField.rst.txt similarity index 82% rename from Documentation/Ctrl/Properties/SeliconField.rst rename to Documentation/Ctrl/_Properties/_SeliconField.rst.txt index 55995083..f5c4b7cf 100644 --- a/Documentation/Ctrl/Properties/SeliconField.rst +++ b/Documentation/Ctrl/_Properties/_SeliconField.rst.txt @@ -1,9 +1,4 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-selicon-field: - -============== -selicon\_field -============== +.. _ctrl-reference-selicon-field: .. confval:: selicon_field :name: ctrl-selicon-field @@ -24,13 +19,9 @@ selicon\_field reference in other records, for example a "category". In such a case this field points out the icon image which will then be shown. This feature can thus enrich the visual experience of selecting the relation in other forms. -Examples -======== - -Select foreign records from a drop-down using selicon ------------------------------------------------------ +.. rubric:: Example: Select foreign records from a drop-down using selicon -.. include:: /Images/Rst/SelectSingle12.rst.txt +.. include:: /Images/Rst/SelectSingle12.rst.txt The table :sql:`tx_styleguide_elements_select_single_12_foreign` is defined as diff --git a/Documentation/Ctrl/Properties/Sortby.rst b/Documentation/Ctrl/_Properties/_Sortby.rst.txt similarity index 93% rename from Documentation/Ctrl/Properties/Sortby.rst rename to Documentation/Ctrl/_Properties/_Sortby.rst.txt index e9c8105f..edf09ec6 100644 --- a/Documentation/Ctrl/Properties/Sortby.rst +++ b/Documentation/Ctrl/_Properties/_Sortby.rst.txt @@ -1,17 +1,11 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-sortby: -====== -sortby -====== - -.. confval:: sortby +.. confval:: sortby :name: ctrl-sortby :Path: $GLOBALS['TCA'][$table]['ctrl'] :type: string (field name) :Scope: Proc. / Display - Field name, which is used to manage the **order** of the records when displayed. The field contains an integer value which positions it at the correct position between other records @@ -24,7 +18,7 @@ sortby Typically the field name :ref:`sorting ` is dedicated to this feature. - .. attention:: + .. attention:: Do not confuse this property with :ref:`default_sortby `. The sortby field contains an integer and is managed by the DataHandler. If by accident a content column like "title" is set as sortby, the DataHandler will write these integers into that field, which is most likely *not* what you want. Use `default_sortby` diff --git a/Documentation/Ctrl/Properties/Title.rst b/Documentation/Ctrl/_Properties/_Title.rst.txt similarity index 53% rename from Documentation/Ctrl/Properties/Title.rst rename to Documentation/Ctrl/_Properties/_Title.rst.txt index bce11f38..545b4b67 100644 --- a/Documentation/Ctrl/Properties/Title.rst +++ b/Documentation/Ctrl/_Properties/_Title.rst.txt @@ -1,17 +1,11 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-title: -===== -title -===== - .. confval:: title :name: ctrl-title :Path: $GLOBALS['TCA'][$table]['ctrl'] :type: string or LLL reference :Scope: Display - Contains the *system name* of the table. Is used for display in the backend. @@ -25,20 +19,18 @@ title reference to a localized string. Refer to the :ref:`Localization ` section for more details. + .. rubric:: Example for table `sys_template` -Examples -======== - -Example for table "sys\_template":: + .. code-block:: - 'ctrl' => [ - 'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:sys_template', - ], + 'ctrl' => [ + 'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:sys_template', + ], -In the above example the :code:`LLL:` prefix tells the system to look up a -label from a localized file. The next prefix code:`EXT:frontend` will look for -the data in the extension with the key "frontend". In that extension the -file :file:`locallang_tca.xlf` contains a XML structure inside of which one -label tag has an index attribute named "sys\_template". This tag -contains the value to display in the default language. Other languages -are provided by the language packs. + In the above example the :code:`LLL:` prefix tells the system to look up a + label from a localized file. The next prefix code:`EXT:frontend` will look for + the data in the extension with the key "frontend". In that extension the + file :file:`locallang_tca.xlf` contains a XML structure inside of which one + label tag has an index attribute named "sys\_template". This tag + contains the value to display in the default language. Other languages + are provided by the language packs. diff --git a/Documentation/Ctrl/Properties/TransOrigDiffSourceField.rst b/Documentation/Ctrl/_Properties/_TransOrigDiffSourceField.rst.txt similarity index 71% rename from Documentation/Ctrl/Properties/TransOrigDiffSourceField.rst rename to Documentation/Ctrl/_Properties/_TransOrigDiffSourceField.rst.txt index d06fc237..c90bbc98 100644 --- a/Documentation/Ctrl/Properties/TransOrigDiffSourceField.rst +++ b/Documentation/Ctrl/_Properties/_TransOrigDiffSourceField.rst.txt @@ -1,11 +1,6 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-transorigdiffsourcefield: -======================== -transOrigDiffSourceField -======================== - -.. confval:: transOrigDiffSourceField +.. confval:: transOrigDiffSourceField :name: ctrl-transOrigDiffSourceField :Path: $GLOBALS['TCA'][$table]['ctrl'] :type: string (field name) @@ -37,14 +32,13 @@ transOrigDiffSourceField Sometimes :sql:`l18n_diffsource` is used for this field in Core tables. This has historic reasons. - .. include:: _AutoCreateWarning.rst.txt + .. include:: /Ctrl/_CodeSnippets/_AutoCreatedColumns/_AutoCreateWarning.rst.txt -.. _ctrl-reference-transorigdiffsourcefield-example: + .. _ctrl-reference-transorigdiffsourcefield-example: -Example: Display changes in from the original language -====================================================== + .. rubric:: Example: Display changes in from the original language -.. include:: /Images/ManualScreenshots/OtherLanguageContent.rst.txt + .. include:: /Images/ManualScreenshots/OtherLanguageContent.rst.txt -.. literalinclude:: _CodeSnippets/_Language.php - :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php + .. literalinclude:: _CodeSnippets/_Language.php + :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php diff --git a/Documentation/Ctrl/Properties/TransOrigPointerField.rst b/Documentation/Ctrl/_Properties/_TransOrigPointerField.rst.txt similarity index 71% rename from Documentation/Ctrl/Properties/TransOrigPointerField.rst rename to Documentation/Ctrl/_Properties/_TransOrigPointerField.rst.txt index 8358e628..36355c6c 100644 --- a/Documentation/Ctrl/Properties/TransOrigPointerField.rst +++ b/Documentation/Ctrl/_Properties/_TransOrigPointerField.rst.txt @@ -1,10 +1,5 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-transorigpointerfield: -===================== -transOrigPointerField -===================== - .. confval:: transOrigPointerField :name: ctrl-transOrigPointerField :Path: $GLOBALS['TCA'][$table]['ctrl'] @@ -32,14 +27,13 @@ transOrigPointerField Sometimes :sql:`l18n_parent` is used for this field in Core tables. This is for historic reasons. - .. include:: _AutoCreateWarning.rst.txt + .. include:: /Ctrl/_CodeSnippets/_AutoCreatedColumns/_AutoCreateWarning.rst.txt -.. _ctrl-reference-transorigpointerfield-example: + .. _ctrl-reference-transorigpointerfield-example: -Example: Define a translation origin -==================================== + .. rubric:: Example: Define a translation origin -.. include:: /Images/Rst/TranslatedText2.rst.txt + .. include:: /Images/Rst/TranslatedText2.rst.txt -.. literalinclude:: _CodeSnippets/_Language.php - :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php + .. literalinclude:: _CodeSnippets/_Language.php + :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php diff --git a/Documentation/Ctrl/Properties/TranslationSource.rst b/Documentation/Ctrl/_Properties/_TranslationSource.rst.txt similarity index 87% rename from Documentation/Ctrl/Properties/TranslationSource.rst rename to Documentation/Ctrl/_Properties/_TranslationSource.rst.txt index 093f8896..57f74b78 100644 --- a/Documentation/Ctrl/Properties/TranslationSource.rst +++ b/Documentation/Ctrl/_Properties/_TranslationSource.rst.txt @@ -1,10 +1,5 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-translationSource: -================= -translationSource -================= - .. confval:: translationSource :name: ctrl-translationSource :Path: $GLOBALS['TCA'][$table]['ctrl'] @@ -40,8 +35,7 @@ translationSource .. _ctrl-reference-translationSource-example: -Example: Keep track of the translation origin in connected mode translations -============================================================================ +.. rubric:: Example: Keep track of the translation origin in connected mode translations .. literalinclude:: _CodeSnippets/_Language.php :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php diff --git a/Documentation/Ctrl/_Properties/_Tstamp.rst.txt b/Documentation/Ctrl/_Properties/_Tstamp.rst.txt new file mode 100644 index 00000000..20ccfb86 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_Tstamp.rst.txt @@ -0,0 +1,26 @@ +.. _ctrl-reference-tstamp: + +.. confval:: tstamp + :name: ctrl-tstamp + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: string (field name) + :Scope: Proc. + + + Field name, which is automatically updated to the current timestamp + (UNIX-time in seconds) each time + the record is updated/saved in the system. + + By convention the name :ref:`tstamp ` is used for that field. + + .. note:: + The database field configured in this property is created automatically. + It does not have to be added to the :file:`ext_tables.sql`. + +.. rubric:: Examples + +The following fields are set by the DataHandler automatically on creating or +updating records, if they are configured in the :php:`ctrl` section of the TCA: + +.. literalinclude:: _CodeSnippets/_DataHandlerFields.php + :caption: EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php diff --git a/Documentation/Ctrl/Properties/Type.rst b/Documentation/Ctrl/_Properties/_Type.rst.txt similarity index 98% rename from Documentation/Ctrl/Properties/Type.rst rename to Documentation/Ctrl/_Properties/_Type.rst.txt index caf666b7..66ded828 100644 --- a/Documentation/Ctrl/Properties/Type.rst +++ b/Documentation/Ctrl/_Properties/_Type.rst.txt @@ -1,17 +1,11 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-type: -==== -type -==== - .. confval:: type :name: ctrl-type :Path: $GLOBALS['TCA'][$table]['ctrl'] :type: string (field name) :Scope: Display / Proc. - Field name, which defines the "record type". The value of this field determines which one of the :ref:`types ` @@ -43,8 +37,6 @@ type Examples -======== - the type stored in a field -------------------------- diff --git a/Documentation/Ctrl/_Properties/_TypeiconClasses.rst.txt b/Documentation/Ctrl/_Properties/_TypeiconClasses.rst.txt new file mode 100644 index 00000000..42890c97 --- /dev/null +++ b/Documentation/Ctrl/_Properties/_TypeiconClasses.rst.txt @@ -0,0 +1,24 @@ +.. _ctrl-reference-typeicon-classes: + +.. confval:: typeicon_classes + :name: ctrl-typeicon-classes + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: array + :Scope: Display + + Array of icon identifiers to use for the records. The keys must correspond to the values found in the column + referenced in the :ref:`typeicon_column ` property. The values correspond + to icons registered in the :ref:`Icon API `. With the key `default`, a default icon is + defined, which is used when no matching key is found. The default icon is also used in the + "Create new record" dialog from the List module. For using and configuring `typeicon_classes` + for custom page types, please see :ref:`Create a new Page Type`. + + .. rubric:: Example from the `tt_content` table: + + .. code-block:: php + + 'typeicon_classes' => [ + 'default' => 'mimetypes-x-content-text', + 'header' => 'mimetypes-x-content-header', + ... + ], diff --git a/Documentation/Ctrl/Properties/TypeiconColumn.rst b/Documentation/Ctrl/_Properties/_TypeiconColumn.rst.txt similarity index 70% rename from Documentation/Ctrl/Properties/TypeiconColumn.rst rename to Documentation/Ctrl/_Properties/_TypeiconColumn.rst.txt index ea7bcbb4..ac18cffc 100644 --- a/Documentation/Ctrl/Properties/TypeiconColumn.rst +++ b/Documentation/Ctrl/_Properties/_TypeiconColumn.rst.txt @@ -1,15 +1,10 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-typeicon-column: +.. _ctrl-reference-typeicon-column: -================ -typeicon\_column -================ - -.. confval:: typeicon_column - :name: ctrl-typeicon-column - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: string (field name) - :Scope: Display +.. confval:: typeicon_column + :name: ctrl-typeicon-column + :Path: $GLOBALS['TCA'][$table]['ctrl'] + :type: string (field name) + :Scope: Display Field name, whose value decides *alternative icons* for the table records. diff --git a/Documentation/Ctrl/Properties/UseColumnsForDefaultValues.rst b/Documentation/Ctrl/_Properties/_UseColumnsForDefaultValues.rst.txt similarity index 80% rename from Documentation/Ctrl/Properties/UseColumnsForDefaultValues.rst rename to Documentation/Ctrl/_Properties/_UseColumnsForDefaultValues.rst.txt index 2219b4b1..b2adb943 100644 --- a/Documentation/Ctrl/Properties/UseColumnsForDefaultValues.rst +++ b/Documentation/Ctrl/_Properties/_UseColumnsForDefaultValues.rst.txt @@ -1,10 +1,5 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-usecolumnsfordefaultvalues: -========================== -useColumnsForDefaultValues -========================== - .. confval:: useColumnsForDefaultValues :name: ctrl-useColumnsForDefaultValues :Path: $GLOBALS['TCA'][$table]['ctrl'] @@ -29,12 +24,11 @@ useColumnsForDefaultValues See :php:`\TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowInitializeNew->DatabaseRowInitializeNew()` -Examples -======== +.. rubric:: Example from "pages" table -Example from "pages" table:: +.. code-block:: php - 'ctrl' => [ - 'useColumnsForDefaultValues' => 'doktype,fe_group,hidden', - ... - ], + 'ctrl' => [ + 'useColumnsForDefaultValues' => 'doktype,fe_group,hidden', + // ... + ], diff --git a/Documentation/Ctrl/Properties/VersioningWS.rst b/Documentation/Ctrl/_Properties/_VersioningWS.rst.txt similarity index 98% rename from Documentation/Ctrl/Properties/VersioningWS.rst rename to Documentation/Ctrl/_Properties/_VersioningWS.rst.txt index c93e765b..3f953b55 100644 --- a/Documentation/Ctrl/Properties/VersioningWS.rst +++ b/Documentation/Ctrl/_Properties/_VersioningWS.rst.txt @@ -1,10 +1,5 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-versioningws: -============ -versioningWS -============ - .. confval:: versioningWS :name: ctrl-versioningWS :Path: $GLOBALS['TCA'][$table]['ctrl'] diff --git a/Documentation/Ctrl/Properties/VersioningWSAlwaysAllowLiveEdit.rst b/Documentation/Ctrl/_Properties/_VersioningWSAlwaysAllowLiveEdit.rst.txt similarity index 81% rename from Documentation/Ctrl/Properties/VersioningWSAlwaysAllowLiveEdit.rst rename to Documentation/Ctrl/_Properties/_VersioningWSAlwaysAllowLiveEdit.rst.txt index e781c1c3..99f6ad3c 100644 --- a/Documentation/Ctrl/Properties/VersioningWSAlwaysAllowLiveEdit.rst +++ b/Documentation/Ctrl/_Properties/_VersioningWSAlwaysAllowLiveEdit.rst.txt @@ -1,10 +1,5 @@ -.. include:: /Includes.rst.txt .. _ctrl-reference-versioningws-alwaysallowliveedit: -================================= -versioningWS\_alwaysAllowLiveEdit -================================= - .. confval:: versioningWS_alwaysAllowLiveEdit :name: ctrl-versioningWS-alwaysAllowLiveEdit :Path: $GLOBALS['TCA'][$table]['ctrl'] diff --git a/Documentation/Ctrl/Properties/PreviewRenderer.rst b/Documentation/Types/Properties/PreviewRenderer.rst similarity index 53% rename from Documentation/Ctrl/Properties/PreviewRenderer.rst rename to Documentation/Types/Properties/PreviewRenderer.rst index 8eaa06b4..54caf923 100644 --- a/Documentation/Ctrl/Properties/PreviewRenderer.rst +++ b/Documentation/Types/Properties/PreviewRenderer.rst @@ -1,42 +1,21 @@ -.. include:: /Includes.rst.txt -.. _ctrl-reference-previewrenderer: +.. include:: /Includes.rst.txt =============== previewRenderer =============== -.. confval:: previewRenderer - :name: ctrl-previewRenderer - :Path: $GLOBALS['TCA'][$table]['ctrl'] - :type: string - :Scope: Display +.. confval:: previewRenderer + :name: types-previewRenderer + :Path: $GLOBALS['TCA'][$table]['ctrl']['previewRenderer'] + :type: string + :Scope: Display - Configures a backend preview for a content element. + Configures a backend preview for a content element. -Examples -======== - -Have also a look at :ref:`t3coreapi:ConfigureCE-Preview` for more details. - -.. note:: - The recommended location of the preview renderer configuration is in the - :php:`ctrl` array in your extension's :file:`Configuration/TCA/$table.php` - or :file:`Configuration/TCA/Overrides/$table.php` file. The former is used - when your extension is the one that creates the table, the latter is used - when you need to override TCA properties of tables added by the Core or - other extensions. - -Use for any record in a table ------------------------------ - -This specifies the preview renderer to be used for any record in -:sql:`tx_myextension_domain_model_mytable`: - -.. code-block:: php - - $GLOBALS['TCA']['tx_myextension_domain_model_mytable']['ctrl']['previewRenderer'] - = \MyVendor\MyExtension\Preview\PreviewRenderer::class; + Have also a look at :ref:`t3coreapi:ConfigureCE-Preview` for more details. + Use :confval:`property previewRenderer of section ctrl ` + to configure the preview globally for the whole table. Table has a :php:`type` field/attribute ---------------------------------------