TCA type 'inline' handling in multi language environment

306 Views Asked by At

The following scenario: I have a page translated (connected mode, not copy/free mode!) with multiple elements that are translated from the default language.
In my elements without inline fields everything is fine!
In my elements with inline fields I am completely confused about the handling and/or the configuration!

Let’s say I have a content element which contains three inline elements (let’s call them “quotes”). If I translate these quotes 1:1 everything works as expected.
Well ... almost:

  1. I can create new quotes in the translation, but they won’t be displayed.
  2. I can change the sorting, which won’t be taken into account in frontend. The frontend uses the sorting of the default language.

If I create a new quote in the default language, I get the record displayed in the translation and can translate it. So this works as expected.

This leads me to my questions:

  1. How do I make it the quotes/inline elements in the translation independent of the default language?
  2. If this is not possible (which would be fine to me, as it contradicts the idea of the Translate/Connected-Mode somehow) how do I get rid of the buttons for Sort and Create new (of cause only in the translation, not the default language!)? Otherwise, of course, editors try this and wonder why it doesn’t work.

I hope I’ve simply forget an option, but I’ve been thinking about it and looking for a solution for hours now that I probably can’t see the forest for the trees.

This might help if it is a missing option:

TCA

'config' => [
    'appearance' => [
        'collapseAll' => '1',
        'enabledControls' => [
            'dragdrop' => '1',
        ],
        'levelLinksPosition' => 'bottom',
        'newRecordLinkTitle' => 'New quote',
        'useSortable' => '1',
        'showSynchronizationLink' => true,
        'showAllLocalizationLink' => true,
        'showPossibleLocalizationRecords' => true,
    ],
    'foreign_field' => 'parent_id',
    'foreign_sortby' => 'sorting',
    'foreign_table' => 'my_quotes_table',
    'foreign_table_field' => 'parent_table',
    'minitems' => '1',
    'type' => 'inline',
],

Typoscript

dataProcessing {
  10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
  10 {
    if.isTrue.field = my_quotes_field
    table = my_quotes_table
    pidInList.field = pid
    where = parent_id=###uid### AND deleted=0 AND hidden=0
    orderBy = sorting
    markers.uid.field = uid
    as = quotes
  }
}

I am using TYPO3 version 11.5.17 with PHP 8.1 and MariaDB 10.5

1

There are 1 best solutions below

1
On

1.How do I make it the quotes/inline elements in the translation independent of the default language?

You cannot (by any standard TYPO3 means) do this in connected mode. Your page needs to be in free-translation mode to do stuff like that.

If you want do hide the field for all the other languages you can add a "displayCond" property to your tca like this:

'displayCond' => [
   'AND' => [
      'FIELD:sys_language_uid:=:0'
   ]
],

This way the field at least stays hidden for the connected languages.