Skip to content

Commit

Permalink
[Backport 12.4] [TASK] Follow up: Merge properties to select multiple…
Browse files Browse the repository at this point in the history
… side by side (#1145)

[TASK] Follow up: Merge properties to select multiple side by side

Releases: main, 12.4

Co-authored-by: lina.wolf <[email protected]>
  • Loading branch information
github-actions[bot] and linawolf authored Aug 6, 2024
1 parent 928ed0e commit 5022b44
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,92 @@ All selected items are displayed in the left field.
.. _tca_example_select_multiplesidebyside_1:

Example: Basic side-by-side select field
================================
========================================

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

.. include:: /CodeSnippets/SelectMultiplesidebyside1.rst.txt

For more examples see also :ref:`columns-select-rendertype-selectMultipleSideBySide-examples`.

.. _columns-select-multiplesidebyside-properties:

Properties of the TCA column type `select` with renderType `selectMultipleSideBySide`
=====================================================================================

.. confval-menu::
:display: table
:type:
:Scope:

.. include:: _Properties/_AllowNonIdValues.rst.txt
:show-buttons:

.. include:: _Properties/_AuthMode.rst.txt
:show-buttons:

.. include:: _Properties/_AuthModeEnforce.rst.txt
:show-buttons:

.. include:: _Properties/_AutoSizeMax.rst.txt
:show-buttons:

.. include:: _Properties/_Behaviour.rst.txt
:show-buttons:

.. include:: _Properties/_DbFieldLength.rst.txt
:show-buttons:

.. include:: _Properties/_Default.rst.txt
:show-buttons:

.. include:: _Properties/_DisableNonMatchingValueElement.rst.txt
:show-buttons:

.. include:: _Properties/_ExclusiveKeys.rst.txt
:show-buttons:

.. include:: _Properties/_FieldControl.rst.txt
:show-buttons:

.. include:: _Properties/_FieldInformation.rst.txt
:show-buttons:

.. include:: _Properties/_FieldWizard.rst.txt
:show-buttons:

.. include:: _Properties/_FileFolderConfig.rst.txt
:show-buttons:

.. include:: _Properties/_ForeignTable.rst.txt
:show-buttons:

.. include:: _Properties/_ForeignTablePrefix.rst.txt
:show-buttons:

.. include:: _Properties/_ForeignTableWhere.rst.txt
:show-buttons:

.. include:: _Properties/_Items.rst.txt
:show-buttons:

.. include:: _Properties/_ItemsProcFunc.rst.txt
:show-buttons:

.. include:: _Properties/_Maxitems.rst.txt
:show-buttons:

.. include:: _Properties/_Minitems.rst.txt
:show-buttons:

.. include:: _Properties/_Mm.rst.txt
:show-buttons:

.. include:: _Properties/_Multiple.rst.txt
:show-buttons:

.. include:: _Properties/_ReadOnly.rst.txt
:show-buttons:

.. include:: _Properties/_Size.rst.txt
:show-buttons:
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
is substituted with the new record, 'prepend' adds the new record on top of
the list, 'append' adds it at the bottom.

.. _tca_example_select_multiplesidebyside_1:

.. rubric:: Example: Multiple sidebyside select field with "Add record" enabled

.. include:: /Images/Rst/SelectMultiplesidebyside1.rst.txt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
.. include:: /Includes.rst.txt
.. _tca_property_fieldControl_editPopup:

=========
editPopup
=========

.. confval:: editPopup
:name: select-byside-fieldControl-editPopup
Expand Down Expand Up @@ -31,7 +25,7 @@ editPopup
:guilabel:`Create new` button

.. confval:: options
:name: select-byside-fieldControl-editPopup-options-title
:name: select-byside-fieldControl-editPopup-options
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldControl']['editPopup']['options']

.. confval:: title
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. _tca_property_fieldControl_resetSelection:

.. confval:: resetSelection
:name: select-byside-fieldControl-resetSelection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@

For details see :confval:`fieldWizard-otherLanguageContent`.

.. _tca_property_fieldWizard_selectIcons:

.. confval:: selectIcons
:name: fieldWizard-selectIcons
:name: select-byside-fieldWizard-selectIcons
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['fieldWizard']['selectIcons']
:type: array
:Scope: fieldWizard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,3 @@

This configuration can be overridden by :ref:`Page
TSconfig<t3tsconfig:fileFolderConfig>`.

.. rubric:: Examples: Select SVGs recursively from a folder

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

.. include:: /CodeSnippets/SelectSingle7.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,3 @@
Usage of the `foreign_table` relation with the table `sys_language`
Has been deprecated. Use TCA field type called
:ref:`language<columns-language>` instead.

.. rubric:: Example: Select singe field with enabled selectIcons

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

.. include:: /CodeSnippets/SelectSingle12.rst.txt

.. rubric:: Example: Select field with foreign table via MM table

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

.. include:: /CodeSnippets/SelectSingle15.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,3 @@
:RenderType: all

Label prefix to the title of the records from the foreign-table.

.. rubric:: Example: Select single field with foreign_prefix and foreign_where

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

.. include:: /CodeSnippets/SelectSingle3.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,57 +12,4 @@
appended to the existing :sql:`WHERE` clause (which contains default constraints,
such as :sql:`NOT deleted`) and must begin with :sql:`AND`.

.. rubric:: Field quoting

The example below uses the special field quoting syntax :php:`{#...}` around
identifiers to be as :ref:`DBAL <t3coreapi:database>`-compatible as possible.
Note that :php:`ORDER BY` and :php:`GROUP BY`
should NOT be quoted, since they always receive proper quoting automatically
through the API.

Markers inside the WHERE statement

It is possible to use markers in the WHERE clause:

###REC\_FIELD\_[*field name*]###
Any field of the current record.

.. note::
The field name part of the marker is not in upper case letters.
It must match the exact case used in the database.

So for example :sql:`sys_language_uid` must be referenced using
`###REC_FIELD_sys_language_uid###`

###THIS\_UID###
Current element uid (zero if new).

###CURRENT\_PID###
The current page id (pid of the record).

###SITEROOT###

:ref:`###PAGE\_TSCONFIG\_ID### <t3tsconfig:tceform-page_tsconfig_id>`
A value you can set from Page TSconfig dynamically.

:ref:`###PAGE\_TSCONFIG\_IDLIST### <t3tsconfig:tceform-page_tsconfig_idlist>`
A value you can set from Page TSconfig dynamically.

:ref:`###PAGE\_TSCONFIG\_STR### <t3tsconfig:tceform-page_tsconfig_str>`
A value you can set from Page TSconfig dynamically.

###SITE:<KEY>.<SUBKEY>###
A value from the site configuration, for example: `###SITE:mySetting.categoryPid###` or `###SITE:rootPageId###`.

The markers are preprocessed so that the value of CURRENT\_PID and PAGE\_TSCONFIG\_ID are always integers
(default is zero), PAGE\_TSCONFIG\_IDLIST will always be a comma-separated list of integers (default is zero)
and PAGE\_TSCONFIG\_STR will be quoted before substitution (default is blank string).

More information about markers set by Page TSconfig can be found in
the :ref:`TSconfig reference <t3tsconfig:pagetceformconfobj>`.

.. rubric:: Example: Select single field with foreign_prefix and foreign_where

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

.. include:: /CodeSnippets/SelectSingle3.rst.txt
See also :confval:`foreign_table <select-single-foreign-table>`.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
value (integer or string)
The value stored in the database.

* The special value `--div--` was used to insert a non-selectable
value that appears as a divider label in the selector box. It is kept
for backwards-compatible reasons. Use :ref:`item groups
<columns-select-byside-properties-item-groups>` for custom selects instead.
* Values must not contain `,` (comma) and `|` (vertical bar). If you want to use :php:`authMode`, you should
also refrain from using `:` (colon).

Expand All @@ -49,9 +45,6 @@
file found inside an extension or use an registered icon identifier. If configured on the :php:`foreign_table`,
:ref:`selicon-field<ctrl-reference-selicon-field>` is respected.

group (string)
The key of the :ref:`item group <columns-select-byside-properties-item-groups>`.

description (string or array)
Fifth value is an optional description text. This is only shown when the list is shown
with `renderType='selectCheckBox'`.
Expand All @@ -62,28 +55,4 @@
the :ref:`default value <columns-select-byside-properties-default>` as well in TCA: :php:`'default' => 0`. Otherwise
issues may arise, e.g. with MySQL strict mode.

.. _tca_example_select_single_1:

.. rubric:: Example: Simple items definition with label and value

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

.. include:: /CodeSnippets/SelectSingle1.rst.txt

.. _tca_example_select_single_4:

.. rubric:: Example: Items definition with label, value and icon

A more complex example could be this (includes icons):

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

.. include:: /CodeSnippets/SelectSingle4.rst.txt

.. rubric:: Example: SelectSingle field with itemGroups

A select single field of size 6 with 3 item groups and one item without group.

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

.. include:: /CodeSnippets/SelectSingle17.rst.txt
For example see :ref:`Side-by-side view with filter <tca_example_select_multiplesidebyside_5>`.
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@
Please have a look into the additional information
in the :ref:`MM common property description <tca_property_MM>`.

.. _tca_example_select_single_15:

.. rubric:: Example: Select field with foreign table via MM table

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

.. include:: /CodeSnippets/SelectSingle15.rst.txt

.. _columns-select-byside-properties-mm-match-fields:

.. confval:: MM_match_fields
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

$selectField = [
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'behaviour' => [
'allowLanguageSynchronization' => true,
],
],
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

$selectField = [
'label' => 'My field',
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'items' => [
['label' => '', 'value' => ''],
['label' => 'Some label', 'value' => 'some'],
['label' => 'Another label', 'value' => 'another'],
],
'default' => '',
'dbFieldLength' => 10,
],
];

0 comments on commit 5022b44

Please sign in to comment.