Skip to content

Commit 5618b93

Browse files
committed
[FEATURE] Hide FormEngine fields with no selectable items
Resolves: TYPO3-Documentation/Changelog-To-Doc#1672 Releases: main, 14.3
1 parent 962e732 commit 5618b93

7 files changed

Lines changed: 211 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.. confval:: showIfEmpty
2+
:name: category-showIfEmpty
3+
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['showIfEmpty']
4+
:type: boolean
5+
:Scope: Display
6+
:Default: false
7+
8+
.. versionchanged:: 14.2
9+
Starting with TYPO3 14.2 relational fields are hidden when no selectable
10+
items are available. This option can be used to disable the behaviour.
11+
12+
By default a field of type `category` is hidden when no categories are
13+
available. Setting `showIfEmpty` to true, shows the field even if no options
14+
are available.
15+
16+
.. code-block:: php
17+
:caption: EXT:my_extension/Configuration/TCA/Overrides/pages.php
18+
19+
$GLOBALS['TCA']['pages']['columns']['categories']['config']['showIfEmpty'] = true;
20+
21+
Possible reasons, why no categories are available: No category records
22+
have been created yet, all categories have been deleted, or
23+
the current user has no permissions for any of the existing categories.

Documentation/ColumnsConfig/Type/Language/Index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,19 @@ types, except `pages`.
6161
In records on root level (`pid=0`) or on a page, outside of a site context,
6262
all languages from all site configurations are displayed in the new field.
6363

64+
.. versionchanged:: 14.2
65+
Fields of type `language` are now hidden by default if only one language is
66+
available.
67+
68+
Fields of type `language` are hidden by default if only one language is
69+
available. They can be displayed nonetheless by setting
70+
`showIfEmpty <https://docs.typo3.org/permalink/t3tca:confval-select-single-showIfEmpty>`_.
71+
72+
Reasons why only one language is available include:
73+
74+
* Only one language has been configured in the
75+
76+
6477
.. _columns-language-examples:
6578
.. _columns-language-simple-example:
6679

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.. confval:: showIfEmpty
2+
:name: select-checkbox-showIfEmpty
3+
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['showIfEmpty']
4+
:type: boolean
5+
:Scope: Display
6+
:Default: false
7+
8+
.. versionchanged:: 14.2
9+
Starting with TYPO3 14.2 relational fields are hidden when no selectable
10+
items are available. This option can be used to disable the behaviour.
11+
12+
By default a field of type `select` and any render type is hidden when no
13+
select items are available. Setting `showIfEmpty` to true, shows the field
14+
even if no options are available.
15+
16+
.. code-block:: php
17+
:caption: EXT:my_extension/Configuration/TCA/Overrides/pages.php
18+
19+
$GLOBALS['TCA']['pages']['columns']['some_select_field']['config']['showIfEmpty'] = true;
20+
21+
Possible reasons, why no select items are available:
22+
23+
* `foreign_table <https://docs.typo3.org/permalink/t3tca:confval-select-checkbox-foreign-table>`_
24+
was used and the referenced table has no records or none matching the
25+
`foreign_table_where <https://docs.typo3.org/permalink/t3tca:confval-select-checkbox-foreign-table-where>`_.
26+
* `foreign_table <https://docs.typo3.org/permalink/t3tca:confval-select-checkbox-foreign-table>`_
27+
was used and the currently logged in user has not permissions for the
28+
referenced table or all of it records.
29+
* All items have been hidden via page TSconfig, for example via
30+
`removeItems <https://docs.typo3.org/permalink/t3tsref:tceform-removeitems>`_
31+
or `keepItems <https://docs.typo3.org/permalink/t3tsref:confval-tceform-keepitems>`_
32+
is inproperly configured.
33+
* The `itemsProcessors <https://docs.typo3.org/permalink/t3tca:confval-select-checkbox-itemsprocessors>`_
34+
or `itemsProcFunc <https://docs.typo3.org/permalink/t3tca:confval-select-checkbox-itemsprocfunc>`_
35+
had no result.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.. confval:: showIfEmpty
2+
:name: select-byside-showIfEmpty
3+
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['showIfEmpty']
4+
:type: boolean
5+
:Scope: Display
6+
:Default: false
7+
8+
.. versionchanged:: 14.2
9+
Starting with TYPO3 14.2 relational fields are hidden when no selectable
10+
items are available. This option can be used to disable the behaviour.
11+
12+
By default a field of type `select` and any render type is hidden when no
13+
select items are available. Setting `showIfEmpty` to true, shows the field
14+
even if no options are available.
15+
16+
.. code-block:: php
17+
:caption: EXT:my_extension/Configuration/TCA/Overrides/pages.php
18+
19+
$GLOBALS['TCA']['pages']['columns']['some_select_field']['config']['showIfEmpty'] = true;
20+
21+
Possible reasons, why no select items are available:
22+
23+
* `foreign_table <https://docs.typo3.org/permalink/t3tca:confval-select-byside-foreign-table>`_
24+
was used and the referenced table has no records or none matching the
25+
`foreign_table_where <https://docs.typo3.org/permalink/t3tca:confval-select-byside-foreign-table-where>`_.
26+
* `foreign_table <https://docs.typo3.org/permalink/t3tca:confval-select-byside-foreign-table>`_
27+
was used and the currently logged in user has not permissions for the
28+
referenced table or all of it records.
29+
* All items have been hidden via page TSconfig, for example via
30+
`removeItems <https://docs.typo3.org/permalink/t3tsref:tceform-removeitems>`_
31+
or `keepItems <https://docs.typo3.org/permalink/t3tsref:confval-tceform-keepitems>`_
32+
is inproperly configured.
33+
* The `itemsProcessors <https://docs.typo3.org/permalink/t3tca:confval-select-byside-itemsprocessors>`_
34+
or `itemsProcFunc <https://docs.typo3.org/permalink/t3tca:confval-select-byside-itemsprocfunc>`_
35+
had no result.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.. confval:: showIfEmpty
2+
:name: select-single-showIfEmpty
3+
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['showIfEmpty']
4+
:type: boolean
5+
:Scope: Display
6+
:Default: false
7+
8+
.. versionchanged:: 14.2
9+
Starting with TYPO3 14.2 relational fields are hidden when no selectable
10+
items are available. This option can be used to disable the behaviour.
11+
12+
By default a field of type `select` and any render type is hidden when no
13+
select items are available. Setting `showIfEmpty` to true, shows the field
14+
even if no options are available.
15+
16+
.. code-block:: php
17+
:caption: EXT:my_extension/Configuration/TCA/Overrides/pages.php
18+
19+
$GLOBALS['TCA']['pages']['columns']['some_select_field']['config']['showIfEmpty'] = true;
20+
21+
Possible reasons, why no select items are available:
22+
23+
* `foreign_table <https://docs.typo3.org/permalink/t3tca:confval-select-single-foreign-table>`_
24+
was used and the referenced table has no records or none matching the
25+
`foreign_table_where <https://docs.typo3.org/permalink/t3tca:confval-select-single-foreign-table-where>`_.
26+
* `foreign_table <https://docs.typo3.org/permalink/t3tca:confval-select-single-foreign-table>`_
27+
was used and the currently logged in user has not permissions for the
28+
referenced table or all of it records.
29+
* All items have been hidden via page TSconfig, for example via
30+
`removeItems <https://docs.typo3.org/permalink/t3tsref:tceform-removeitems>`_
31+
or `keepItems <https://docs.typo3.org/permalink/t3tsref:confval-tceform-keepitems>`_
32+
is inproperly configured.
33+
* The `itemsProcessors <https://docs.typo3.org/permalink/t3tca:confval-select-single-itemsprocessors>`_
34+
or `itemsProcFunc <https://docs.typo3.org/permalink/t3tca:confval-select-single-itemsprocfunc>`_
35+
had no result.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.. confval:: showIfEmpty
2+
:name: select-singlebox-showIfEmpty
3+
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['showIfEmpty']
4+
:type: boolean
5+
:Scope: Display
6+
:Default: false
7+
8+
.. versionchanged:: 14.2
9+
Starting with TYPO3 14.2 relational fields are hidden when no selectable
10+
items are available. This option can be used to disable the behaviour.
11+
12+
By default a field of type `select` and any render type is hidden when no
13+
select items are available. Setting `showIfEmpty` to true, shows the field
14+
even if no options are available.
15+
16+
.. code-block:: php
17+
:caption: EXT:my_extension/Configuration/TCA/Overrides/pages.php
18+
19+
$GLOBALS['TCA']['pages']['columns']['some_select_field']['config']['showIfEmpty'] = true;
20+
21+
Possible reasons, why no select items are available:
22+
23+
* `foreign_table <https://docs.typo3.org/permalink/t3tca:confval-select-singlebox-foreign-table>`_
24+
was used and the referenced table has no records or none matching the
25+
`foreign_table_where <https://docs.typo3.org/permalink/t3tca:confval-select-singlebox-foreign-table-where>`_.
26+
* `foreign_table <https://docs.typo3.org/permalink/t3tca:confval-select-singlebox-foreign-table>`_
27+
was used and the currently logged in user has not permissions for the
28+
referenced table or all of it records.
29+
* All items have been hidden via page TSconfig, for example via
30+
`removeItems <https://docs.typo3.org/permalink/t3tsref:tceform-removeitems>`_
31+
or `keepItems <https://docs.typo3.org/permalink/t3tsref:confval-tceform-keepitems>`_
32+
is inproperly configured.
33+
* The `itemsProcessors <https://docs.typo3.org/permalink/t3tca:confval-select-singlebox-itemsprocessors>`_
34+
or `itemsProcFunc <https://docs.typo3.org/permalink/t3tca:confval-select-singlebox-itemsprocfunc>`_
35+
had no result.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.. confval:: showIfEmpty
2+
:name: select-tree-showIfEmpty
3+
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['showIfEmpty']
4+
:type: boolean
5+
:Scope: Display
6+
:Default: false
7+
8+
.. versionchanged:: 14.2
9+
Starting with TYPO3 14.2 relational fields are hidden when no selectable
10+
items are available. This option can be used to disable the behaviour.
11+
12+
By default a field of type `select` and any render type is hidden when no
13+
select items are available. Setting `showIfEmpty` to true, shows the field
14+
even if no options are available.
15+
16+
.. code-block:: php
17+
:caption: EXT:my_extension/Configuration/TCA/Overrides/pages.php
18+
19+
$GLOBALS['TCA']['pages']['columns']['some_select_field']['config']['showIfEmpty'] = true;
20+
21+
Possible reasons, why no select items are available:
22+
23+
* `foreign_table <https://docs.typo3.org/permalink/t3tca:confval-select-tree-foreign-table>`_
24+
was used and the referenced table has no records or none matching the
25+
`foreign_table_where <https://docs.typo3.org/permalink/t3tca:confval-select-tree-foreign-table-where>`_.
26+
* `foreign_table <https://docs.typo3.org/permalink/t3tca:confval-select-tree-foreign-table>`_
27+
was used and the currently logged in user has not permissions for the
28+
referenced table or all of it records.
29+
* All items have been hidden via page TSconfig, for example via
30+
`removeItems <https://docs.typo3.org/permalink/t3tsref:tceform-removeitems>`_
31+
or `keepItems <https://docs.typo3.org/permalink/t3tsref:confval-tceform-keepitems>`_
32+
is inproperly configured.
33+
* The `itemsProcessors <https://docs.typo3.org/permalink/t3tca:confval-select-tree-itemsprocessors>`_
34+
or `itemsProcFunc <https://docs.typo3.org/permalink/t3tca:confval-select-tree-itemsprocfunc>`_
35+
had no result.

0 commit comments

Comments
 (0)