Skip to content

Commit

Permalink
[TASK] Overhaul group type
Browse files Browse the repository at this point in the history
* Correct indentation,
* add names for confvals

releases: main, 12.4, 11.5
  • Loading branch information
linawolf committed Mar 27, 2024
1 parent 8d91133 commit 353c58e
Show file tree
Hide file tree
Showing 14 changed files with 396 additions and 395 deletions.
16 changes: 8 additions & 8 deletions Documentation/ColumnsConfig/Type/Group/Examples.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
.. include:: /Includes.rst.txt
.. _columns-group-examples:
.. include:: /Includes.rst.txt
.. _columns-group-examples:

========
Examples
========


.. _tca_example_group_db_10:
.. _tca_example_group_db_10:

Group relation to a single page
===============================

.. include:: /Images/Rst/GroupDb10.rst.txt
.. include:: /Images/Rst/GroupDb10.rst.txt

.. include:: /CodeSnippets/GroupDb10.rst.txt
.. include:: /CodeSnippets/GroupDb10.rst.txt


.. _tca_example_group_db_1:
.. _tca_example_group_db_1:

Group relation to be_groups and be_users
========================================

.. include:: /Images/Rst/GroupDb1.rst.txt
.. include:: /Images/Rst/GroupDb1.rst.txt

.. include:: /CodeSnippets/GroupDb1.rst.txt
.. include:: /CodeSnippets/GroupDb1.rst.txt
32 changes: 16 additions & 16 deletions Documentation/ColumnsConfig/Type/Group/Index.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
.. include:: /Includes.rst.txt
.. _columns-group:
.. _columns-group-introduction:
.. include:: /Includes.rst.txt
.. _columns-group:
.. _columns-group-introduction:

============
Group fields
============

.. versionchanged:: 12.0
The newly introduced column type :ref:`folder <columns-folder>` replaces
the old combination of :php:`type => 'group'` together with
:php:`internal_type => 'folder'`.
.. versionchanged:: 12.0
The newly introduced column type :ref:`folder <columns-folder>` replaces
the old combination of :php:`type => 'group'` together with
:php:`internal_type => 'folder'`.

.. versionadded:: 13.0
When using the `group` type, TYPO3 takes care of
:ref:`generating the according database field <t3coreapi:auto-generated-db-structure>`.
A developer does not need to define this field in an extension's
:file:`ext_tables.sql` file.
When using the `group` type, TYPO3 takes care of
:ref:`generating the according database field <t3coreapi:auto-generated-db-structure>`.
A developer does not need to define this field in an extension's
:file:`ext_tables.sql` file.


The group element (:php:`type' => 'group'`) in TYPO3 makes it possible to create references from a record of one table to many records from multiple tables in the system. The foreign tables can be the table itself (thus a self-reference) or any other table.
Expand All @@ -38,9 +38,9 @@ The group field uses either the CSV format to store uids of related records or a

You can read more on how data is structured in :ref:`columns-group-data` chapter.

.. toctree::
:titlesonly:
.. toctree::
:titlesonly:

Examples
StoredDataValues
Properties/Index
Examples
StoredDataValues
Properties/Index
38 changes: 19 additions & 19 deletions Documentation/ColumnsConfig/Type/Group/Properties/Allowed.rst
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
.. include:: /Includes.rst.txt
.. _columns-group-properties-allowed:
.. include:: /Includes.rst.txt
.. _columns-group-properties-allowed:

=======
allowed
=======

.. confval:: allowed
.. confval:: allowed
:name: group-allowed
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: string (list)
:Scope: Proc. / Display

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: string (list)
:Scope: Proc. / Display
A comma list of tables from :php:`$GLOBALS['TCA']`, for example "pages,be\_users".

A comma list of tables from :php:`$GLOBALS['TCA']`, for example "pages,be\_users".
.. note::
If the field is the foreign side of a bidirectional MM relation, only the first table is used and that
must be the table of the records on the native side of the relation.

.. note::
If the field is the foreign side of a bidirectional MM relation, only the first table is used and that
must be the table of the records on the native side of the relation.

.. note::
When using Extbase, you also need to fill
:ref:`foreign_table <columns-group-properties-foreign-table>`
property with the same table name as used in
:ref:`allowed <columns-group-properties-allowed>` property
(but with just one table name).
.. note::
When using Extbase, you also need to fill
:ref:`foreign_table <columns-group-properties-foreign-table>`
property with the same table name as used in
:ref:`allowed <columns-group-properties-allowed>` property
(but with just one table name).

Examples
========

Group relation to be_groups and be_users
----------------------------------------

.. include:: /Images/Rst/GroupDb1.rst.txt
.. include:: /Images/Rst/GroupDb1.rst.txt

.. include:: /CodeSnippets/GroupDb1.rst.txt
.. include:: /CodeSnippets/GroupDb1.rst.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
.. include:: /Includes.rst.txt
.. _columns-group-properties-elementBrowserEntryPoints:
.. include:: /Includes.rst.txt
.. _columns-group-properties-elementBrowserEntryPoints:

==========================
elementBrowserEntryPoints
==========================

.. confval:: elementBrowserEntryPoints (type => group)
.. confval:: elementBrowserEntryPoints
:name: group-elementBrowserEntryPoints
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: array
:Scope: Display

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: array
:Scope: Display
By default, the last selected page is used when opening the element browser.
Setting this configuration value changes this behaviour.

By default, the last selected page is used when opening the element browser.
Setting this configuration value changes this behaviour.
This configuration value is a PHP :php:`array`, containing `table => id`
pairs. When opening the element browser for a specific table (buttons below
the group field), the defined page is then always selected by default. There
is also the special `_default` key, used for the general element browser
button (on the right side of the group field), which is not dedicated to a
specific table.

This configuration value is a PHP :php:`array`, containing `table => id`
pairs. When opening the element browser for a specific table (buttons below
the group field), the defined page is then always selected by default. There
is also the special `_default` key, used for the general element browser
button (on the right side of the group field), which is not dedicated to a
specific table.
This configuration value also supports the known
markers `###SITEROOT###`, `###CURRENT_PID###` and `###PAGE_TSCONFIG_<key>###`.

This configuration value also supports the known
markers `###SITEROOT###`, `###CURRENT_PID###` and `###PAGE_TSCONFIG_<key>###`.

Each `table => id` pair can also be overridden via page TSconfig.
Each `table => id` pair can also be overridden via page TSconfig.

Examples
========

Open the element browser on page 123 for tt_content elements
-------------------------------------------------------------

.. code-block:: php
.. code-block:: php
'simple_group' => [
'label' => 'Simple group field',
Expand All @@ -47,7 +47,7 @@ Open the element browser on page 123 for tt_content elements
This could then be overridden via page TSconfig:

.. code-block:: typoscript
.. code-block:: typoscript
TCEFORM.my_table.simple_group.config.elementBrowserEntryPoints.tt_content = 321
Expand All @@ -59,7 +59,7 @@ Open the element browser on different pages for tt_content and news records
In case the group field allows more than one table, the `_default` key has to
be set:

.. code-block:: php
.. code-block:: php
'extended_group' => [
'label' => 'Extended group field',
Expand All @@ -76,6 +76,6 @@ be set:
Of course, the `_default` key can also be overridden via page TSconfig:

.. code-block:: typoscript
.. code-block:: typoscript
TCEFORM.my_table.extended_group.config.elementBrowserEntryPoints._default = 122
56 changes: 28 additions & 28 deletions Documentation/ColumnsConfig/Type/Group/Properties/FieldControl.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. include:: /Includes.rst.txt
.. _columns-group-properties-fieldControl:
.. _tca_property_fieldControl_elementBrowser:
.. _columns-group-properties-elementBrowser:
.. _tca_property_fieldControl_insertClipboard:
.. include:: /Includes.rst.txt
.. _columns-group-properties-fieldControl:
.. _tca_property_fieldControl_elementBrowser:
.. _columns-group-properties-elementBrowser:
.. _tca_property_fieldControl_insertClipboard:

============
fieldControl
Expand All @@ -11,46 +11,46 @@ fieldControl
The field of type group can enable all common :ref:`field control options
<tca_property_fieldControl>`. Furthermore the following are available:

.. confval:: elementBrowser (type => group)
.. confval:: elementBrowser
:name: group-fieldControl
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']
:type: array
:Scope: fieldControl
:Types: :ref:`group <columns-group>`

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']
:type: array
:Scope: fieldControl
:Types: :ref:`group <columns-group>`
The element browser field control used in :code:`type='group'` renders a
button to open an element browser. It is enabled by default if rendering a
group element.

The element browser field control used in :code:`type='group'` renders a
button to open an element browser. It is enabled by default if rendering a
group element.
.. confval:: insertClipboard

.. confval:: insertClipboard (type => group)
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']
:type: array
:Scope: fieldControl
:Types: :ref:`group <columns-group>`

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']
:type: array
:Scope: fieldControl
:Types: :ref:`group <columns-group>`

The clipboard control adds a control button for :code:`type='group'` to paste records from
a users clipboard into the selection. It is enabled by default for :code:`type='group'` and
shown below the **element browser** if the
order has not been changed using the `before` and `after` keywords. It can be turned off by
setting `disabled` to true, just like any other fieldControl.
The clipboard control adds a control button for :code:`type='group'` to paste records from
a users clipboard into the selection. It is enabled by default for :code:`type='group'` and
shown below the **element browser** if the
order has not been changed using the `before` and `after` keywords. It can be turned off by
setting `disabled` to true, just like any other fieldControl.

Examples
========

Group field with element browser enabled
----------------------------------------

.. include:: /Images/Rst/GroupDb1.rst.txt
.. include:: /Images/Rst/GroupDb1.rst.txt

.. include:: /CodeSnippets/GroupDb1.rst.txt
.. include:: /CodeSnippets/GroupDb1.rst.txt


Group field with element browser disabled
-----------------------------------------

The element browser control can be disabled by setting :php:`disabled = true`:

.. include:: /Images/Rst/GroupDb3.rst.txt
.. include:: /Images/Rst/GroupDb3.rst.txt

.. include:: /CodeSnippets/GroupDb3.rst.txt
.. include:: /CodeSnippets/GroupDb3.rst.txt
34 changes: 17 additions & 17 deletions Documentation/ColumnsConfig/Type/Group/Properties/FieldWizard.rst
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
.. include:: /Includes.rst.txt
.. _group-fieldWizard:
.. include:: /Includes.rst.txt
.. _group-fieldWizard:

===========
fieldWizard
===========

For general fieldWizard documentation see :ref:`here <tca_property_fieldWizard>`.

.. _tca_property_fieldWizard_recordsOverview:
.. _tca_property_fieldWizard_recordsOverview:

.. confval:: recordsOverview
.. confval:: recordsOverview
:name: group-recordsOverview
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']
:type: array
:Scope: fieldWizard

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']
:type: array
:Scope: fieldWizard
Render an overview of the selected records with correct icon and click menu and title. Allows to
perform actions on the selected records directly. Links the record title to a direct editing form.

Render an overview of the selected records with correct icon and click menu and title. Allows to
perform actions on the selected records directly. Links the record title to a direct editing form.
.. _tca_property_fieldWizard_tableList:

.. _tca_property_fieldWizard_tableList:
.. confval:: tableList

.. confval:: tableList
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']
:type: array
:Scope: fieldWizard

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']
:type: array
:Scope: fieldWizard

Render a list of allowed tables and link to element browser. This field wizard is enabled by default.
This wizard allows to easily select records from a popup.
Render a list of allowed tables and link to element browser. This field wizard is enabled by default.
This wizard allows to easily select records from a popup.
Loading

0 comments on commit 353c58e

Please sign in to comment.