From 86e39e6860240e8f1ade2ed06836c17e376c1dc2 Mon Sep 17 00:00:00 2001 From: Lina Wolf <48202465+linawolf@users.noreply.github.com> Date: Thu, 26 Sep 2024 07:25:35 +0200 Subject: [PATCH] [TASK] Merge properties back into columns page (#1173) Releases: main, 12.4 --- Documentation/Columns/DisplayConditions.rst | 227 ++++++++++++++++++ Documentation/Columns/Examples.rst | 60 +++++ Documentation/Columns/Index.rst | 55 +++-- Documentation/Columns/Properties/Config.rst | 28 --- .../Columns/Properties/DisplayCond.rst | 211 ---------------- Documentation/Columns/Properties/Index.rst | 16 -- .../Columns/_Properties/_Config.rst.txt | 36 +++ .../_Description.rst.txt} | 19 +- .../Columns/_Properties/_DisplayCond.rst.txt | 13 + .../_Exclude.rst.txt} | 11 +- .../_L10nDisplay.rst.txt} | 37 +-- .../_L10nMode.rst.txt} | 40 +-- .../Label.rst => _Properties/_Label.rst.txt} | 6 +- .../_OnChange.rst.txt} | 11 +- 14 files changed, 378 insertions(+), 392 deletions(-) create mode 100644 Documentation/Columns/DisplayConditions.rst delete mode 100644 Documentation/Columns/Properties/Config.rst delete mode 100644 Documentation/Columns/Properties/DisplayCond.rst delete mode 100644 Documentation/Columns/Properties/Index.rst create mode 100644 Documentation/Columns/_Properties/_Config.rst.txt rename Documentation/Columns/{Properties/Description.rst => _Properties/_Description.rst.txt} (63%) create mode 100644 Documentation/Columns/_Properties/_DisplayCond.rst.txt rename Documentation/Columns/{Properties/Exclude.rst => _Properties/_Exclude.rst.txt} (87%) rename Documentation/Columns/{Properties/L10nDisplay.rst => _Properties/_L10nDisplay.rst.txt} (53%) rename Documentation/Columns/{Properties/L10nMode.rst => _Properties/_L10nMode.rst.txt} (67%) rename Documentation/Columns/{Properties/Label.rst => _Properties/_Label.rst.txt} (92%) rename Documentation/Columns/{Properties/OnChange.rst => _Properties/_OnChange.rst.txt} (85%) diff --git a/Documentation/Columns/DisplayConditions.rst b/Documentation/Columns/DisplayConditions.rst new file mode 100644 index 00000000..f1305bf7 --- /dev/null +++ b/Documentation/Columns/DisplayConditions.rst @@ -0,0 +1,227 @@ +.. include:: /Includes.rst.txt + +.. _columns-displaycond: + +================================= +Display conditions in TCA columns +================================= + +Display conditions (:confval:`$GLOBALS['TCA'][$table]['columns'][$field][displayCond] `) +can be used to only display the affected field if certain other fields are set +to certain values. + +Conditions can be grouped and nested using boolean operators :code:`AND` or :code:`OR` as +array keys. See examples below. + +.. contents:: Table of contents + +.. _columns-displaycond-rules: + +Rules in display conditions +=========================== + +A rule is a string divided into several parts by ":" (colons). The first part is +the rule-type and the subsequent parts depend on the rule type. + +The following rules are available: + +FIELD + This evaluates based on another field's value in the record. + + - Part 1 is the field name + + - Part 2 is the evaluation type. These are the possible options: + + REQ + Requires the field to have a "true" value. False values are "" (blank string) and 0 (zero). + Everything else is true. For the REQ evaluation type Part 3 of the rules string must be the string "true" + or "false". If "true" then the rule returns "true" if the evaluation is true. If "false" then the rule + returns "true" if the evaluation is false. + + **> / < / >= / <=** + Evaluates if the field value is greater than, less than the value in "Part 3" + + **= / !=** + Evaluates if the field value is equal to value in "Part 3" + + **IN / !IN** + Evaluates if the field value is in the comma list equal to value in "Part 3" + + **- / !-** + Evaluates if the field value is in the range specified by value in "Part 3" ([min] - [max]) + + **BIT / !BIT** + Evaluates if the bit specified by the value in "Part 3" is set in the field's value + (considered as an integer) + + - Part 3 is a comma separated list of string or numeric values + +REC:NEW:true + This will show the field for new records which have not been saved yet. + +REC:NEW:false + This will show the field for existing records which have already been saved. + +HIDE\_FOR\_NON\_ADMINS + This will hide the field for all non-admin users while admins can see it. + Useful for FlexForm container fields which are not supposed to be edited directly via the FlexForm but + rather through some other interface. + +USER + userFunc call with a fully qualified class name. + + Additional parameters can be passed separated by colon: + :php:`USER:Evoweb\\Example\\User\\MyConditionMatcher->checkHeader:some:more:info` + + The following arguments are passed as array to the userFunc: + + - :php:`record`: the currently edited record + - :php:`flexContext`: details about the FlexForm if the condition is used in one + - :php:`flexformValueKey`: `vDEF` + - :php:`conditionParameters`: additional parameters + + The called method is expected to return a :php:`bool` value: :php:`true` if the field should be displayed, :php:`false` otherwise. + +VERSION:IS + Evaluate if a record is a "versioned" record from workspaces. + + - Part 1 is the type: + + IS + Part 2 is "true" or "false": If true, the field is shown only if the record is a version (pid == -1). + Example to show a field in "Live" workspace only: :php:`VERSION:IS:false` + +In FlexForm, display conditions can be attached to single fields in sheets, to sheets itself, to flex section fields +and to flex section container element fields. :code:`FIELD` references can be prefixed with a sheet name to +reference a field from a neighbor sheet, see examples below. + +.. tip:: + Fields used in a conditions should have the column option + :confval:`columns-onChange` set to reload. + +.. _columns-displaycond-examples: + +Examples for display conditions +=============================== + +.. _columns-displaycond-examples-basic: + +Basic display condition +------------------------ + +This example will require the field named "tx\_templavoila\_ds" to be true, otherwise the field for which this rule +is set will not be displayed: + +.. code-block:: php + + 'displayCond' => 'FIELD:tx_templavoila_ds:REQ:true', + +.. _columns-displaycond-examples-combined: + +Combining conditions +-------------------- + +Multiple conditions can be combined: + +.. code-block:: php + + 'displayCond' => [ + 'AND' => [ + 'FIELD:tx_templavoila_ds:REQ:true', + 'FIELD:header:=:Headline', + ], + ], + + +An example with multiple values and :code:`OR`: + +.. code-block:: php + :caption: EXT:my_extension/Configuration/TCA/Overrides/tx_mask_field.php + + $GLOBALS['TCA']['tx_mask_table']['columns']['tx_mask_field']['displayCond']['OR'] = [ + 'FIELD:tx_mask_otherfield:=:1', + 'FIELD:tx_mask_otherfield:=:2', + 'FIELD:tx_mask_otherfield:=:4', + ]; + + +This is the same as: + +.. code-block:: php + :caption: EXT:my_extension/Configuration/TCA/Overrides/tx_mask_field.php + + $GLOBALS['TCA']['tx_mask_table']['columns']['tx_mask_field']['displayCond'] + = 'FIELD:tx_mask_otherfield:IN:1,2,4'; + + +.. _columns-displaycond-examples-complex: + +A complex example +----------------- + +Going further the next example defines the following conditions: for the +"example_field" field to be displayed, the content element must be in the +default language. Furthermore it must be a text-type element or have the +headline "Example" defined: + +.. code-block:: php + + 'displayCond' => [ + 'AND' => [ + 'FIELD:sys_language_uid:=:0', + 'OR' => [ + 'FIELD:CType:=:text', + 'FIELD:header:=:Example' + ] + ] + ], + +.. _columns-displaycond-examples-flexform: + +A complex example in a FlexForm +------------------------------- + +Using :code:`OR` and :code:`AND` within FlexForms works like this: + +.. code-block:: xml + + + + FIELD:sys_language_uid:=:0 + + FIELD:CType:=:text + FIELD:header:=:Example + + + + + +.. _columns-displaycond-examples-flexform-value: + +Access values in a flexform +--------------------------- + +Flex form fields can access field values from various different sources: + +.. code-block:: xml + + + FIELD:parentRec.header:REQ:true + + FIELD:parentRec.field_1:!=:foo + + FIELD:flexField_1:!=:foo + + FIELD:sheet_1.flexField_1:!=:foo + + +.. _columns-displaycond-technical: + +Technical background +==================== + +The display conditions are implemented in class +:php:`\TYPO3\CMS\Backend\Form\FormDataProvider\EvaluateDisplayConditions`, +which is a :ref:`FormDataProvider `. +It can be used for fields directly in the record as well as for +FlexForm values. diff --git a/Documentation/Columns/Examples.rst b/Documentation/Columns/Examples.rst index d4a6f1e9..9363b5c1 100644 --- a/Documentation/Columns/Examples.rst +++ b/Documentation/Columns/Examples.rst @@ -1,5 +1,7 @@ .. include:: /Includes.rst.txt +.. _columns-example: + ======== Examples ======== @@ -16,6 +18,8 @@ The following examples all can be found in the Styleguide; select_single_12 pair: selectSingle; Images +.. _columns-example-drop down: + Select drop-down for records represented by images ================================================== @@ -40,3 +44,59 @@ Inline relation (IRRE) spanning multiple tables Inline relation to a foreign table: .. include:: /CodeSnippets/Inline1n1nInline1.rst.txt + +.. _tca_example_translated_text_2: + +Example: prefixLangTitle +======================== + +The following example can be found in the :ref:`extension styleguide +`. On translating a record in a new language the content of the +field gets copied to the target language. It get prefixed with +:code:`[Translate to :]`. + +.. include:: /Images/Rst/TranslatedText2.rst.txt + +The language mode is defined as follows: + +.. include:: /CodeSnippets/TranslatedText2.rst.txt + +.. _tca_example_l10n_mode: + +Disable the prefixLangTitle for the header field in tt_content +============================================================== + +Use the default behaviour instead of :php:`prefixLangTitle`: the field will +be copied without a prepended string. + +.. code-block:: php + :caption: EXT:my_sitepackage/Configuration/TCA/Overrides/tt_content.php + + $GLOBALS['TCA']['tt_content']['columns']['header']['l10n_mode'] = '' + +.. _tca_example_translated_select_single_13: + +Select field with `defaultAsReadonly` +===================================== + +The following field has the option :php:`'l10n_display' => 'defaultAsReadonly'` +set: + +.. include:: /Images/Rst/TranslatedSelectSingle13.rst.txt + +Complete TCA definition of the field: + +.. include:: /CodeSnippets/SelectSingle13.rst.txt + +.. _tca_example_translated_select_single_8: + +Translated field without `l10n_display` definition +================================================== + +The following has no :php:`'l10n_display'` definition: + +.. include:: /Images/Rst/TranslatedSelectSingle8.rst.txt + +Complete TCA definition of the field: + +.. include:: /CodeSnippets/SelectSingle8.rst.txt diff --git a/Documentation/Columns/Index.rst b/Documentation/Columns/Index.rst index ba3239fe..c84d11a1 100644 --- a/Documentation/Columns/Index.rst +++ b/Documentation/Columns/Index.rst @@ -14,30 +14,43 @@ submitted data. Each field can be configured as a certain "type" (**required!**), for instance a checkbox, an input field, or a database relation selector box. Each type allows a set of additional "renderType"s (**sometimes required!**). Each "type" and "renderType" combination comes with a set of additional properties. -The basic structure looks like this: - -.. code-block:: php - - 'columns' => [ - 'aField' => [ - 'label' => 'someLabel', - 'config' => [ - 'type' => 'aType', - 'renderType' => 'aRenderType', - // ... - ], - // ... - ], - ], - -Properties on the level parallel to "label" are valid for all "type" and "renderType" combinations. +.. contents:: Content on this page + +.. toctree:: + :caption: Subpages + :titlesonly: + :glob: + + * + +.. _columns-example-basic: + +Example: A basic input field +============================ + +The basic structure of a field definition in TCA looks like this: + +.. include:: /Images/Rst/Input1.rst.txt + +.. include:: /CodeSnippets/Input1.rst.txt + +You can find this example in the :ref:`extension styleguide `. + +Properties on the level parallel to :confval:`label ` +are valid for all "type" and "renderType" combinations. They are listed below. The list of properties within the "config" section depend on the specific "type" and "renderType" combination and are explained in detail in the :ref:`['columns']['config'] ` section. .. _columns-properties: -.. toctree:: - :titlesonly: +Properties of `columns` section of TCA +====================================== + +.. confval-menu:: + :name: columns + :display: table + :type: + :Scope: - Examples - Properties/Index + .. include:: _Properties/_*.rst.txt + :show-buttons: diff --git a/Documentation/Columns/Properties/Config.rst b/Documentation/Columns/Properties/Config.rst deleted file mode 100644 index 8a0cef08..00000000 --- a/Documentation/Columns/Properties/Config.rst +++ /dev/null @@ -1,28 +0,0 @@ -.. include:: /Includes.rst.txt -.. _columns-properties-config: - -====== -config -====== - -.. confval:: config - :name: columns-config - :Path: $GLOBALS['TCA'][$table]['columns'][$field] - :Required: true - :type: array - :Scope: Proc. / Display - - Contains the main configuration properties of the fields display and processing behavior. - - The possibilities for this array depend on the value of the array keys "type" and "renderType" within the array, - see :ref:`the dedicated section ` for details. - -Examples -======== - -Simple input field ------------------- - -.. include:: /Images/Rst/Input1.rst.txt - -.. include:: /CodeSnippets/Input1.rst.txt diff --git a/Documentation/Columns/Properties/DisplayCond.rst b/Documentation/Columns/Properties/DisplayCond.rst deleted file mode 100644 index 9b85cb5d..00000000 --- a/Documentation/Columns/Properties/DisplayCond.rst +++ /dev/null @@ -1,211 +0,0 @@ -.. include:: /Includes.rst.txt -.. _columns-properties-displaycond: - -=========== -displayCond -=========== - -The display conditions are implemented in class -`TYPO3\\CMS\\Backend\\Form\\FormDataProvider\\EvaluateDisplayConditions -`_, -which is a :ref:`FormDataProvider`. -It can be used for fields directly in the record as well as for -FlexForm values. - - -.. confval:: displayCond - :name: columns-displayCond - :Path: $GLOBALS['TCA'][$table]['columns'][$field] - :Required: false - :type: string / array - :Scope: Display - - Contains one or more condition rules for whether to display the field or not. - - Conditions can be grouped and nested using boolean operators :code:`AND` or :code:`OR` as - array keys. See examples below. - - A rule is a string divided into several parts by ":" (colons). The first part is the rule-type and the subsequent - parts depend on the rule type. - - The following rules are available: - - FIELD - This evaluates based on another field's value in the record. - - - Part 1 is the field name - - - Part 2 is the evaluation type. These are the possible options: - - REQ - Requires the field to have a "true" value. False values are "" (blank string) and 0 (zero). - Everything else is true. For the REQ evaluation type Part 3 of the rules string must be the string "true" - or "false". If "true" then the rule returns "true" if the evaluation is true. If "false" then the rule - returns "true" if the evaluation is false. - - **> / < / >= / <=** - Evaluates if the field value is greater than, less than the value in "Part 3" - - **= / !=** - Evaluates if the field value is equal to value in "Part 3" - - **IN / !IN** - Evaluates if the field value is in the comma list equal to value in "Part 3" - - **- / !-** - Evaluates if the field value is in the range specified by value in "Part 3" ([min] - [max]) - - **BIT / !BIT** - Evaluates if the bit specified by the value in "Part 3" is set in the field's value - (considered as an integer) - - - Part 3 is a comma separated list of string or numeric values - - REC:NEW:true - This will show the field for new records which have not been saved yet. - - REC:NEW:false - This will show the field for existing records which have already been saved. - - HIDE\_FOR\_NON\_ADMINS - This will hide the field for all non-admin users while admins can see it. - Useful for FlexForm container fields which are not supposed to be edited directly via the FlexForm but - rather through some other interface. - - USER - userFunc call with a fully qualified class name. - - Additional parameters can be passed separated by colon: - :php:`USER:Evoweb\\Example\\User\\MyConditionMatcher->checkHeader:some:more:info` - - The following arguments are passed as array to the userFunc: - - - :php:`record`: the currently edited record - - :php:`flexContext`: details about the FlexForm if the condition is used in one - - :php:`flexformValueKey`: `vDEF` - - :php:`conditionParameters`: additional parameters - - The called method is expected to return a :php:`bool` value: :php:`true` if the field should be displayed, :php:`false` otherwise. - - VERSION:IS - Evaluate if a record is a "versioned" record from workspaces. - - - Part 1 is the type: - - IS - Part 2 is "true" or "false": If true, the field is shown only if the record is a version (pid == -1). - Example to show a field in "Live" workspace only: :php:`VERSION:IS:false` - - In FlexForm, display conditions can be attached to single fields in sheets, to sheets itself, to flex section fields - and to flex section container element fields. :code:`FIELD` references can be prefixed with a sheet name to - reference a field from a neighbor sheet, see examples below. - -.. tip:: - Fields used in a conditions should have the column option - :confval:`columns-onChange` set to reload. - - -Examples -======== - -Simple display condition ------------------------- - -This example will require the field named "tx\_templavoila\_ds" to be true, otherwise the field for which this rule -is set will not be displayed: - -.. code-block:: php - - 'displayCond' => 'FIELD:tx_templavoila_ds:REQ:true', - - -Combining conditions --------------------- - -Multiple conditions can be combined: - -.. code-block:: php - - 'displayCond' => [ - 'AND' => [ - 'FIELD:tx_templavoila_ds:REQ:true', - 'FIELD:header:=:Headline', - ], - ], - - -An example with multiple values and :code:`OR`: - -.. code-block:: php - :caption: EXT:my_extension/Configuration/TCA/Overrides/tx_mask_field.php - - $GLOBALS['TCA']['tx_mask_table']['columns']['tx_mask_field']['displayCond']['OR'] = [ - 'FIELD:tx_mask_otherfield:=:1', - 'FIELD:tx_mask_otherfield:=:2', - 'FIELD:tx_mask_otherfield:=:4', - ]; - - -This is the same as: - -.. code-block:: php - :caption: EXT:my_extension/Configuration/TCA/Overrides/tx_mask_field.php - - $GLOBALS['TCA']['tx_mask_table']['columns']['tx_mask_field']['displayCond'] - = 'FIELD:tx_mask_otherfield:IN:1,2,4'; - - -A complex example ------------------ - -Going further the next example defines the following conditions: for the -"example_field" field to be displayed, the content element must be in the -default language. Furthermore it must be a text-type element or have the -headline "Example" defined: - -.. code-block:: php - - 'displayCond' => [ - 'AND' => [ - 'FIELD:sys_language_uid:=:0', - 'OR' => [ - 'FIELD:CType:=:text', - 'FIELD:header:=:Example' - ] - ] - ], - - -A complex example in a FlexForm -------------------------------- - -Using :code:`OR` and :code:`AND` within FlexForms works like this: - -.. code-block:: xml - - - - FIELD:sys_language_uid:=:0 - - FIELD:CType:=:text - FIELD:header:=:Example - - - - - -Access values in a flexform ---------------------------- - -Flex form fields can access field values from various different sources: - -.. code-block:: xml - - - FIELD:parentRec.header:REQ:true - - FIELD:parentRec.field_1:!=:foo - - FIELD:flexField_1:!=:foo - - FIELD:sheet_1.flexField_1:!=:foo diff --git a/Documentation/Columns/Properties/Index.rst b/Documentation/Columns/Properties/Index.rst deleted file mode 100644 index 03960619..00000000 --- a/Documentation/Columns/Properties/Index.rst +++ /dev/null @@ -1,16 +0,0 @@ -.. include:: /Includes.rst.txt - -========== -Properties -========== - -.. toctree:: - - Config - Description - DisplayCond - Exclude - L10nDisplay - L10nMode - Label - OnChange diff --git a/Documentation/Columns/_Properties/_Config.rst.txt b/Documentation/Columns/_Properties/_Config.rst.txt new file mode 100644 index 00000000..7f215912 --- /dev/null +++ b/Documentation/Columns/_Properties/_Config.rst.txt @@ -0,0 +1,36 @@ +.. _columns-properties-config: + +.. confval:: config + :name: columns-config + :Path: $GLOBALS['TCA'][$table]['columns'][$field]['config'] + :Required: true + :type: array + :Scope: Proc. / Display + :Example: :ref:`columns-example-basic` + + Contains the main configuration properties of the fields display and + processing behavior. + + The possibilities for this array depend on the value of the array keys + :confval:`columns-config-type` and :confval:`columns-config-rendertype` + within the array. + + .. confval:: type + :name: columns-config-type + :Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['type'] + :Required: true + :type: string, one of the :ref:`column types ` + + The `type` influences the rendering of the form field in the backend. + It also influences the processing of data on saving the values. + + .. confval:: rendertype + :name: columns-config-rendertype + :Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['rendertype'] + :Required: true + :type: string + + For some :confval:`columns-config-type` definitions there are additional + render types available that mainly influence rendering. For example + :ref:`Select fields ` and + :ref:`Text areas ` provide different render types. diff --git a/Documentation/Columns/Properties/Description.rst b/Documentation/Columns/_Properties/_Description.rst.txt similarity index 63% rename from Documentation/Columns/Properties/Description.rst rename to Documentation/Columns/_Properties/_Description.rst.txt index e538ea63..fbeed8b8 100644 --- a/Documentation/Columns/Properties/Description.rst +++ b/Documentation/Columns/_Properties/_Description.rst.txt @@ -1,16 +1,12 @@ -.. include:: /Includes.rst.txt .. _columns-properties-description: -=========== -Description -=========== - .. confval:: description :name: columns-description :Path: $GLOBALS['TCA'][$table]['columns'][$field] :Required: false :type: string or LLL reference :Scope: Display + :Example: :ref:`columns-example-basic` The property can be used to display an additional help text between the field label and the user input when editing records. As an example, the Core uses the description property @@ -18,15 +14,6 @@ Description The property is available on all common `TCA` types like `input` and `select` and so on. -Example -======= - -.. include:: /Images/Rst/Input1.rst.txt - - -The field can be used with a string that will be directly output or with a -language reference: - -.. include:: /CodeSnippets/Input1.rst.txt + The field can be used with a string that will be directly output or with a + language reference. -You can find this example in the :ref:`extension styleguide `. diff --git a/Documentation/Columns/_Properties/_DisplayCond.rst.txt b/Documentation/Columns/_Properties/_DisplayCond.rst.txt new file mode 100644 index 00000000..176f0f48 --- /dev/null +++ b/Documentation/Columns/_Properties/_DisplayCond.rst.txt @@ -0,0 +1,13 @@ +.. _columns-properties-displaycond: + +.. confval:: displayCond + :name: columns-displayCond + :Path: $GLOBALS['TCA'][$table]['columns'][$field] + :Required: false + :type: string / array + :Scope: Display + :Example: :ref:`columns-displaycond-examples` + + Contains one or more condition rules for whether to display the field or not. + + Read more in the dedicated chapter :ref:`columns-displaycond`. diff --git a/Documentation/Columns/Properties/Exclude.rst b/Documentation/Columns/_Properties/_Exclude.rst.txt similarity index 87% rename from Documentation/Columns/Properties/Exclude.rst rename to Documentation/Columns/_Properties/_Exclude.rst.txt index c3da7e30..dee0eded 100644 --- a/Documentation/Columns/Properties/Exclude.rst +++ b/Documentation/Columns/_Properties/_Exclude.rst.txt @@ -1,10 +1,5 @@ -.. include:: /Includes.rst.txt .. _columns-properties-exclude: -======= -exclude -======= - .. confval:: exclude :name: columns-exclude :Path: $GLOBALS['TCA'][$table]['columns'][$field] @@ -19,11 +14,7 @@ exclude See :ref:`Access lists ` for more about permissions. -Example -======= - -Simple input field ------------------- +.. rubric:: Example: Simple input field .. code-block:: php diff --git a/Documentation/Columns/Properties/L10nDisplay.rst b/Documentation/Columns/_Properties/_L10nDisplay.rst.txt similarity index 53% rename from Documentation/Columns/Properties/L10nDisplay.rst rename to Documentation/Columns/_Properties/_L10nDisplay.rst.txt index 81fc018a..04983b16 100644 --- a/Documentation/Columns/Properties/L10nDisplay.rst +++ b/Documentation/Columns/_Properties/_L10nDisplay.rst.txt @@ -1,16 +1,12 @@ -.. include:: /Includes.rst.txt .. _columns-properties-l10n-display: -==================================== -Localization display (l10n\_display) -==================================== - .. confval:: l10n_display :name: columns-l10n-display :Path: $GLOBALS['TCA'][$table]['columns'][$field] :Required: false :type: string (list of keywords) :Scope: Display + :Example: :ref:`tca_example_translated_select_single_13`, :ref:`tca_example_translated_select_single_8` Localization display, see :ref:`l10n\_mode `. @@ -29,34 +25,3 @@ Localization display (l10n\_display) :ref:`l10n_mode ` is set to :php:`'exclude'`. While `exclude` defines the field not to be translatable, this option activates the display of the default data. - - -Examples -======== - -.. _tca_example_translated_select_single_13: - -Select field with `defaultAsReadonly` -------------------------------------- - -The following field has the option :php:`'l10n_display' => 'defaultAsReadonly'` -set: - -.. include:: /Images/Rst/TranslatedSelectSingle13.rst.txt - -Complete TCA definition of the field: - -.. include:: /CodeSnippets/SelectSingle13.rst.txt - -.. _tca_example_translated_select_single_8: - -Translated field without `l10n_display` definition --------------------------------------------------- - -The following has no :php:`'l10n_display'` definition: - -.. include:: /Images/Rst/TranslatedSelectSingle8.rst.txt - -Complete TCA definition of the field: - -.. include:: /CodeSnippets/SelectSingle8.rst.txt diff --git a/Documentation/Columns/Properties/L10nMode.rst b/Documentation/Columns/_Properties/_L10nMode.rst.txt similarity index 67% rename from Documentation/Columns/Properties/L10nMode.rst rename to Documentation/Columns/_Properties/_L10nMode.rst.txt index 6cf604b0..f636c700 100644 --- a/Documentation/Columns/Properties/L10nMode.rst +++ b/Documentation/Columns/_Properties/_L10nMode.rst.txt @@ -1,16 +1,12 @@ -.. include:: /Includes.rst.txt .. _columns-properties-l10n-mode: -============================= -Localization mode (l10n_mode) -============================= - .. confval:: l10n_mode :name: columns-l10n-mode :Path: $GLOBALS['TCA'][$table]['columns'][$field] :Required: false :type: string (keyword) :Scope: Display / Proc. + :Example: :ref:`tca_example_translated_text_2`, :ref:`tca_example_l10n_mode` Only active if the :ref:`['ctrl']['languageField'] ` property is set. @@ -36,37 +32,3 @@ Localization mode (l10n_mode) If this property is not set for a given field, the value of the default language record is copied over to the localized record on creation, the field value is then distinct from the default language record, can be edited at will and will never be overwritten by the DataHandler if the value of the default language record changes. - -Examples -======== - -.. _tca_example_translated_text_2: - -prefixLangTitle ---------------- - -The following example can be found in the :ref:`extension styleguide -`. On translating a record in a new language the content of the -field gets copied to the target language. It get prefixed with -:code:`[Translate to :]`. - -.. include:: /Images/Rst/TranslatedText2.rst.txt - - -The language mode is defined as follows: - -.. include:: /CodeSnippets/TranslatedText2.rst.txt - - -.. _tca_example_l10n_mode: - -Disable the prefixLangTitle for the header field in tt_content --------------------------------------------------------------- - -Use the default behaviour instead of :php:`prefixLangTitle`: the field will -be copied without a prepended string. - -.. code-block:: php - :caption: EXT:my_sitepackage/Configuration/TCA/Overrides/tt_content.php - - $GLOBALS['TCA']['tt_content']['columns']['header']['l10n_mode'] = '' diff --git a/Documentation/Columns/Properties/Label.rst b/Documentation/Columns/_Properties/_Label.rst.txt similarity index 92% rename from Documentation/Columns/Properties/Label.rst rename to Documentation/Columns/_Properties/_Label.rst.txt index 97b40ee2..a2658075 100644 --- a/Documentation/Columns/Properties/Label.rst +++ b/Documentation/Columns/_Properties/_Label.rst.txt @@ -1,16 +1,12 @@ -.. include:: /Includes.rst.txt .. _columns-properties-label: -===== -label -===== - .. confval:: label :name: columns-label :Path: $GLOBALS['TCA'][$table]['columns'][$field] :Required: true :type: string or LLL reference :Scope: Display + :Example: :ref:`columns-example-basic` The name of the field as shown in the form: diff --git a/Documentation/Columns/Properties/OnChange.rst b/Documentation/Columns/_Properties/_OnChange.rst.txt similarity index 85% rename from Documentation/Columns/Properties/OnChange.rst rename to Documentation/Columns/_Properties/_OnChange.rst.txt index dac13f7f..03a790be 100644 --- a/Documentation/Columns/Properties/OnChange.rst +++ b/Documentation/Columns/_Properties/_OnChange.rst.txt @@ -1,10 +1,5 @@ -.. include:: /Includes.rst.txt .. _columns-properties-onChange: -======== -onChange -======== - .. confval:: onChange :name: columns-onChange :Path: $GLOBALS['TCA'][$table]['columns'][$field] @@ -23,11 +18,7 @@ onChange .. include:: /Images/Rst/CtrlTypeChangeModal.rst.txt -Examples -======== - -Select field triggering reload ------------------------------- +.. rubric:: Example: Select field triggering reload .. include:: /Images/Rst/SelectRequestupdate1.rst.txt .. include:: /CodeSnippets/SelectRequestupdate1.rst.txt