-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Feature: #97193 - New TCA type “number”
https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Feature-97193-NewTCATypeNumber.html refs TYPO3-Documentation/TYPO3CMS-Reference-CoreApi#1624
- Loading branch information
Showing
14 changed files
with
371 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
Documentation/ColumnsConfig/Type/Input/Properties/Slider.rst
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
.. include:: /Includes.rst.txt | ||
|
||
.. _columns-number: | ||
|
||
====== | ||
Number | ||
====== | ||
|
||
.. versionadded:: 12.0 | ||
The TCA type :php:`number` has been introduced. It replaces the | ||
:php:`eval=int` and :php:`eval=double2` options of TCA type :php:`input`. | ||
|
||
|
||
The TCA type :php:`number` should be used to input values representing numbers. | ||
|
||
|
||
.. note:: | ||
|
||
The :ref:`slider <columns-number-properties-slider>` option allows to define | ||
a visual slider element, next to the input field. The steps can be | ||
defined with the :ref:`slider[step] <columns-number-properties-slider>` | ||
option. The minimum and maximum value can be configured with the | ||
:ref:`range[lower] <columns-number-properties-range>` and | ||
:ref:`range[upper] <columns-number-properties-range>` options. | ||
|
||
Migration | ||
========= | ||
|
||
Migration from eval='int' | ||
------------------------- | ||
|
||
The migration from :php:`eval='int'` to :php:`type=number` | ||
is done like following: | ||
|
||
.. code-block:: php | ||
// Before | ||
'int_field => [ | ||
'label' => 'Int field', | ||
'config' => [ | ||
'type' => 'input', | ||
'eval' => 'int', | ||
] | ||
] | ||
// After | ||
'int_field => [ | ||
'label' => 'Int field', | ||
'config' => [ | ||
'type' => 'number', | ||
] | ||
] | ||
Migration from eval='double2' | ||
----------------------------- | ||
|
||
The migration from :php:`eval=double2` to :php:`type=number` | ||
is done like following: | ||
|
||
.. code-block:: php | ||
// Before | ||
'double2_field => [ | ||
'label' => 'double2 field', | ||
'config' => [ | ||
'type' => 'input', | ||
'eval' => 'double2', | ||
] | ||
] | ||
// After | ||
'double2_field => [ | ||
'label' => 'double2 field', | ||
'config' => [ | ||
'type' => 'number', | ||
'format' => 'decimal' | ||
] | ||
] | ||
An automatic TCA migration is performed on the fly, migrating all occurrences | ||
to the new TCA type and triggering a PHP :php:`E_USER_DEPRECATED` error | ||
where code adoption has to take place. | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
Properties/Index |
28 changes: 28 additions & 0 deletions
28
Documentation/ColumnsConfig/Type/Number/Properties/Autocomplete.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.. include:: /Includes.rst.txt | ||
.. _columns-number-properties-autocomplete: | ||
|
||
============ | ||
autocomplete | ||
============ | ||
|
||
.. confval:: autocomplete ('type' => 'number') | ||
|
||
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config'] | ||
:type: boolean | ||
:Scope: Display | ||
|
||
Controls the `autocomplete` attribute of a given email field. If set to true (default false), | ||
adds attribute :php:`autocomplete="on"` to the email input field allowing browser auto filling the field: | ||
|
||
.. code-block:: php | ||
:emphasize-lines: 7 | ||
'email' => [ | ||
'label' => 'number', | ||
'config' => [ | ||
'type' => 'number', | ||
'size' => 20, | ||
'eval' => 'null', | ||
'autocomplete' => true | ||
] | ||
], |
38 changes: 38 additions & 0 deletions
38
Documentation/ColumnsConfig/Type/Number/Properties/Eval.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.. include:: /Includes.rst.txt | ||
.. _columns-number-properties-eval: | ||
|
||
==== | ||
eval | ||
==== | ||
|
||
.. confval:: eval ('type' => 'number') | ||
|
||
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config'] | ||
:type: string (list of keywords) | ||
:Scope: Display / Proc. | ||
|
||
Configuration of field evaluation. | ||
|
||
Some of these evaluation keywords will trigger a JavaScript pre- evaluation | ||
in the form. Other evaluations will be performed in the backend. The | ||
evaluation functions will be executed in the list-order. | ||
|
||
Keywords: | ||
|
||
null | ||
An empty value (string) will be stored as :code:`NULL` in the database, | ||
requires a proper sql definition. | ||
|
||
Examples | ||
======== | ||
|
||
|
||
.. code-block:: php | ||
'aField' => [ | ||
'label' => 'aLabel', | ||
'config' => [ | ||
'type' => 'number', | ||
'eval' => 'null', | ||
], | ||
], |
14 changes: 14 additions & 0 deletions
14
Documentation/ColumnsConfig/Type/Number/Properties/Format.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.. include:: /Includes.rst.txt | ||
.. _columns-number-properties-format: | ||
|
||
====== | ||
format | ||
====== | ||
|
||
.. confval:: format (type => number) | ||
|
||
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config'] | ||
:type: string (keyword) | ||
:Scope: Display | ||
|
||
Keywords: :php:`integer`, :php:`decimal` |
38 changes: 38 additions & 0 deletions
38
Documentation/ColumnsConfig/Type/Number/Properties/Index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.. include:: /Includes.rst.txt | ||
.. _columns-number-properties: | ||
|
||
========== | ||
Properties | ||
========== | ||
|
||
Special properties | ||
================== | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
:glob: | ||
|
||
* | ||
|
||
Common properties | ||
================= | ||
|
||
* :ref:`behaviour > allowLanguageSynchronization <tca_property_behaviour_allowLanguageSynchronization>` | ||
* :ref:`default <tca_property_default>` | ||
* :ref:`fieldControl <tca_property_fieldControl>` | ||
* :ref:`fieldInformation <tca_property_fieldInformation>` | ||
* :ref:`fieldWizard <tca_property_fieldWizard>` with the following options | ||
|
||
* :ref:`defaultLanguageDifferences <tca_property_fieldwizard>` | ||
* :ref:`localizationStateSelector <tca_property_fieldWizard_localizationStateSelector>` | ||
* :ref:`otherLanguageContent <tca_property_fieldWizard_otherLanguageContent>` | ||
|
||
* :ref:`mode <tca_property_mode>` | ||
* :ref:`placeholder <tca_property_placeholder>` | ||
* :ref:`readOnly <tca_property_readOnly>` | ||
* :ref:`required <tca_property_required>` | ||
|
||
.. note:: | ||
|
||
The softref definition :php:`softref=>email[subst]` is automatically applied | ||
to all :php:`email` fields. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
Documentation/ColumnsConfig/Type/Number/Properties/Size.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.. include:: /Includes.rst.txt | ||
.. _columns-number-properties-size: | ||
|
||
==== | ||
size | ||
==== | ||
|
||
.. confval:: size ('type' => 'number') | ||
|
||
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config'] | ||
:type: integer | ||
:Scope: Display | ||
|
||
Abstract value for the width of the :code:`<input>` field. To set the email | ||
field to the full width of the form area, use the value 50. Minimum is 10. | ||
Default is 30. |
Oops, something went wrong.