Skip to content

Commit

Permalink
[TASK] Overhaul inline 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 445a5d1 commit a5406e5
Show file tree
Hide file tree
Showing 22 changed files with 444 additions and 444 deletions.
170 changes: 85 additions & 85 deletions Documentation/ColumnsConfig/Type/Inline/Examples.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. include:: /Includes.rst.txt
.. _columns-inline-examples:
.. include:: /Includes.rst.txt
.. _columns-inline-examples:

========
Examples
Expand All @@ -9,26 +9,26 @@ Examples
Inline fields should not be used anymore to handle files. Use the TCA
column type :ref:`file <columns-file>` instead.

.. _columns-inline-examples-images:
.. _columns-inline-examples-1nRelation:
.. _tca_example_inline_1n_inline_1:
.. _columns-inline-examples-images:
.. _columns-inline-examples-1nRelation:
.. _tca_example_inline_1n_inline_1:

Simple 1:n relation
===================

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

This combines a table (for example companies) with a child table (for example
employees).

.. include:: /CodeSnippets/Inline1nInline1.rst.txt
.. include:: /CodeSnippets/Inline1nInline1.rst.txt

.. _columns-inline-examples-asymmetric-mm:
.. _columns-inline-examples-asymmetric-mm:

Attributes on anti-symmetric intermediate table
===============================================

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

The record has two child records displayed inline.

Expand All @@ -40,25 +40,25 @@ attributes to every relation – in this example a checkbox.

The parent table :php:`tx_styleguide_inline_mn` contains the following column:

.. include:: /CodeSnippets/InlineMnInline1.rst.txt
.. include:: /CodeSnippets/InlineMnInline1.rst.txt

If the child table :php:`tx_styleguide_inline_mn_child` wants to display its parents also it needs to define a
column like in this example:

.. include:: /CodeSnippets/InlineMnChildParents.rst.txt
.. include:: /CodeSnippets/InlineMnChildParents.rst.txt

The intermediate table :php:`tx_styleguide_inline_mn_mm` defines the following fields:

.. include:: /CodeSnippets/Manual/InlineMnMm.rst.txt
.. include:: /CodeSnippets/Manual/InlineMnMm.rst.txt


.. _columns-inline-examples-symmetric-mm:
.. _tca_example_inline_mn_symmetric_11_branches:
.. _columns-inline-examples-symmetric-mm:
.. _tca_example_inline_mn_symmetric_11_branches:

Attributes on symmetric intermediate table
==========================================

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

Record 1 is related to records 6 and 11 of the same table

Expand All @@ -69,14 +69,14 @@ also related to record A. However, the records are not stored in groups. If
record A is related to B and C, B doesn't have to be related to C.


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

Record 11 is symmetrically related to record 1 but not to 6

The main table :php:`tx_styleguide_inline_mnsymmetric` has a field storing the
inline relation, here: :php:`branches`.

.. include:: /CodeSnippets/InlineMnSymmetricBranches.rst.txt
.. include:: /CodeSnippets/InlineMnSymmetricBranches.rst.txt

Records of the main table can than have a symmetric relationship to each other
using the intermediate table :php:`tx_styleguide_inline_mnsymmetric_mm`.
Expand All @@ -85,26 +85,26 @@ The intermediate table stores the uids of both sides of the relation in
:php:`hotelid` and :php:`branchid`. Furthermore custom sorting can be defined in
both directions.

.. include:: /CodeSnippets/Manual/InlineMnSymetricMm.rst.txt
.. include:: /CodeSnippets/Manual/InlineMnSymetricMm.rst.txt

.. note::
:typoscript:`TCAdefaults.<table>.pid = <page id>` can be used to define the pid of new child records. Thus, it's possible to
have special storage folders on a per-table-basis. See the :ref:`TSconfig reference <t3tsconfig:usertoplevelobjects>`.
.. note::
:typoscript:`TCAdefaults.<table>.pid = <page id>` can be used to define the pid of new child records. Thus, it's possible to
have special storage folders on a per-table-basis. See the :ref:`TSconfig reference <t3tsconfig:usertoplevelobjects>`.

.. _tca_example_inline_usecombinationc_inline_1:
.. _tca_example_inline_usecombinationc_inline_1:

With a combination box
======================

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

The combination box shows available records. On clicking one entry it gets
added to the parent record.


.. include:: /CodeSnippets/InlineUsecombinationcInline1.rst.txt
.. include:: /CodeSnippets/InlineUsecombinationcInline1.rst.txt

.. _inline-example-field-information:
.. _inline-example-field-information:

Add a custom fieldInformation
=============================
Expand All @@ -116,46 +116,46 @@ As explained in the :ref:`description <columns-inline>`, :code:`fieldInformation
or :code:`fieldWizard` must be configured within the :code:`ctrl` **for the field
type inline** - as it is a container.

.. rst-class:: bignums-xxl
.. rst-class:: bignums-xxl

#. Create a custom fieldInformation

.. code-block:: php
:caption: EXT:my_extension/Classes/FormEngine/FieldInformation/DemoFieldInformation
.. code-block:: php
:caption: EXT:my_extension/Classes/FormEngine/FieldInformation/DemoFieldInformation
<?php
declare(strict_types=1);
namespace Myvendor\Myexample\FormEngine\FieldInformation;
use TYPO3\CMS\Backend\Form\AbstractNode;
class DemoFieldInformation extends AbstractNode
{
public function render()
{
$fieldName = $this->data['fieldName'];
$result = $this->initializeResultArray();
// Add fieldInformation only for this field name
// this may be changed accordingly
if ($fieldName !== 'my_new_field') {
return $result;
}
$text = $GLOBALS['LANG']->sL(
'LLL:EXT:my_example/Resources/Private/Language/'
. 'locallang_db.xlf:tt_content.fieldInformation.demo'
);
$result['html'] = $text;
return $result;
}
}
<?php
declare(strict_types=1);
namespace Myvendor\Myexample\FormEngine\FieldInformation;
use TYPO3\CMS\Backend\Form\AbstractNode;
class DemoFieldInformation extends AbstractNode
{
public function render()
{
$fieldName = $this->data['fieldName'];
$result = $this->initializeResultArray();
// Add fieldInformation only for this field name
// this may be changed accordingly
if ($fieldName !== 'my_new_field') {
return $result;
}
$text = $GLOBALS['LANG']->sL(
'LLL:EXT:my_example/Resources/Private/Language/'
. 'locallang_db.xlf:tt_content.fieldInformation.demo'
);
$result['html'] = $text;
return $result;
}
}
#. Register this node type

.. code-block:: php
:caption: EXT:my_extension/ext_localconf.php
.. code-block:: php
:caption: EXT:my_extension/ext_localconf.php
<?php
use Myvendor\Myexample\FormEngine\FieldInformation\DemoFieldInformation;
Expand All @@ -170,34 +170,34 @@ type inline** - as it is a container.
#. Add the fieldInformation to the container for containerRenderType inline

.. code-block:: php
:caption: EXT:my_extension/Configuration/TCA/Overrides/tt_content.php
.. code-block:: php
:caption: EXT:my_extension/Configuration/TCA/Overrides/tt_content.php
$GLOBALS['TCA']['tt_content']['ctrl']['container']['inline']['fieldInformation'] = [
'demoFieldInformation' => [
'renderType' => 'demoFieldInformation',
],
];
$GLOBALS['TCA']['tt_content']['ctrl']['container']['inline']['fieldInformation'] = [
'demoFieldInformation' => [
'renderType' => 'demoFieldInformation',
],
];
#. A field my_new_field is created in the tt_content TCA:

.. code-block:: php
:caption: EXT:my_extension/Configuration/TCA/Overrides/tt_content.php
'my_new_field2' => [
'label' => 'inline field with field information',
'config' => [
'type' => 'inline',
// further configuration can be found in the examples above
// ....
],
],
// ...
.. seealso::

* :ref:`['ctrl']['container'] <ctrl-reference-container>`
* How to create custom fieldInformation, fieldControl or fieldWizard in
:ref:`FormEngine <t3coreapi:FormEngine-Rendering-NodeExpansion>` chapter (TYPO3
Explained)
* :ref:`fieldInformation <tca_property_fieldInformation>` property
.. code-block:: php
:caption: EXT:my_extension/Configuration/TCA/Overrides/tt_content.php
'my_new_field2' => [
'label' => 'inline field with field information',
'config' => [
'type' => 'inline',
// further configuration can be found in the examples above
// ....
],
],
// ...
.. seealso::

* :ref:`['ctrl']['container'] <ctrl-reference-container>`
* How to create custom fieldInformation, fieldControl or fieldWizard in
:ref:`FormEngine <t3coreapi:FormEngine-Rendering-NodeExpansion>` chapter (TYPO3
Explained)
* :ref:`fieldInformation <tca_property_fieldInformation>` property
28 changes: 14 additions & 14 deletions Documentation/ColumnsConfig/Type/Inline/Index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. include:: /Includes.rst.txt
.. _columns-inline:
.. _columns-inline-introduction:
.. include:: /Includes.rst.txt
.. _columns-inline:
.. _columns-inline-introduction:

=============
IRRE / inline
Expand Down Expand Up @@ -37,18 +37,18 @@ question (for instance a description). This information can be overwritten for t
"tt_content" by adding a new description in table "sys_file_reference". The various inline and field properties
like "placeholder" help managing this complex setup in TCA.

.. hint::
.. hint::

The type inline does not have the properties :code:`fieldInformation`,
:code:`fieldControl` or :code:`fieldWizard` like the other types. This is
due to the fact that this type is a container and not an element. You can
still add fieldInformation or fieldWizard, but this must be configured
within the :code:`ctrl`. Please see the
:ref:`example <inline-example-field-information>`.
The type inline does not have the properties :code:`fieldInformation`,
:code:`fieldControl` or :code:`fieldWizard` like the other types. This is
due to the fact that this type is a container and not an element. You can
still add fieldInformation or fieldWizard, but this must be configured
within the :code:`ctrl`. Please see the
:ref:`example <inline-example-field-information>`.

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

Properties/Index
Examples
Properties/Index
Examples

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. include:: /Includes.rst.txt
.. _columns-inline-properties-appearance:
.. include:: /Includes.rst.txt
.. _columns-inline-properties-appearance:

==========
appearance
Expand All @@ -14,8 +14,8 @@ appearance

Use the TCA column type :ref:`file <columns-file>` to handle files.

.. confval:: appearance (type => inline)

.. confval:: appearance
:name: inline-appearance
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']
:type: array
:Scope: Display
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.. include:: /Includes.rst.txt
.. include:: /Includes.rst.txt

=========================================
disableMovingChildrenWithParent behaviour
=========================================

.. confval:: behaviour > disableMovingChildrenWithParent
.. confval:: behaviour[disableMovingChildrenWithParent]
:name: inline-behaviour-disableMovingChildrenWithParent
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['behaviour']
:type: boolean
:Scope: Proc.

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['behaviour']
:type: boolean
:Scope: Proc.
Default false. Disables that child records get moved along with their parent records. Usually if in a parent-child
relation a parent record is moved to a different page (eg. via cut+paste from clipboard), the children are relocated
along with the parent. This flag disables the child move.

Default false. Disables that child records get moved along with their parent records. Usually if in a parent-child
relation a parent record is moved to a different page (eg. via cut+paste from clipboard), the children are relocated
along with the parent. This flag disables the child move.

This property can be especially useful if all child records should be gathered in one storage folder and their
parents are spread out at different places in the page tree. In combination with the
:ref:`Tsconfig setting <t3tsconfig:usertoplevelobjects>` :typoscript:`TCAdefaults.<table>.pid = <page id>` children
can be forced to be created in this folder and stay there.
This property can be especially useful if all child records should be gathered in one storage folder and their
parents are spread out at different places in the page tree. In combination with the
:ref:`Tsconfig setting <t3tsconfig:usertoplevelobjects>` :typoscript:`TCAdefaults.<table>.pid = <page id>` children
can be forced to be created in this folder and stay there.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.. include:: /Includes.rst.txt
.. include:: /Includes.rst.txt

=====================
enableCascadingDelete
=====================

.. confval:: behaviour > enableCascadingDelete
.. confval:: behaviour[enableCascadingDelete]
:name: inline-behaviour-enableCascadingDelete
:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['behaviour']
:type: boolean
:Scope: Proc.

:Path: $GLOBALS['TCA'][$table]['columns'][$field]['config']['behaviour']
:type: boolean
:Scope: Proc.

Default true. Usually in inline relations, if a parent is deleted, all children are deleted along with the parent.
This flag can be used to disable that cascading delete. Example usage: A frontend user (parent) has assigned
invoices (children). If a frontend user is deleted, it could be useful to keep the invoices.
Default true. Usually in inline relations, if a parent is deleted, all children are deleted along with the parent.
This flag can be used to disable that cascading delete. Example usage: A frontend user (parent) has assigned
invoices (children). If a frontend user is deleted, it could be useful to keep the invoices.
Loading

0 comments on commit a5406e5

Please sign in to comment.