3

I'm currently building a TYPO3 PageTemplate with Flux and Fluidpages (both GitHub Master-Branch). I'd like to have the possibility to select a number of ContentElements from the PageTree and store the UIDs in a variable for later rendering.

My first approach combining a Flux TreeField with a RelationField:

  <flux:form.sheet name="content" label="content settings">
    <flux:field.tree
      name="treetest"
      label="treetest"
      table="pages"
      parentField="pid"
      foreignLabel="title"
      multiple="true"
      minItems="0"
      maxItems="1000"
      size="8"
      expandAll="false"
    />
    <flux:field.relation
      name="relationtest"
      label="relationtest"
      table="tt_content"
      condition="AND tt_content.pid IN ({treetest})"
      multiple="true"
      size="8"
      minItems="0"
      maxItems="3"
    />
  </flux:form.sheet>

This sadly results in a SQL-Error because the last condition is inserted as:

  AND tt_content.pid IN (60|foo)

Where 'foo' is the title of a SysFolder with the UID 60.

Debug-Output in the frontend prints the field 'treetest' as:

  treetest => '60' (2 chars)

and the condition for the field 'relationtest' as:

  condition => 'AND tt_content.pid IN (60)' (26 chars)

Questions:

  1. As a matter of fact, I'm missing something here and I'd appreciate any hint, where the crux is here?

  2. Is there maybe a different solution to select a ContentElement from the PageTree?

Danilo
  • 3,257
  • 2
  • 19
  • 24
Alex K.
  • 31
  • 5

1 Answers1

1

1) It is possible that you have either a default value, an inherited value or somehow disconnected XML which contains the other value. To be 100% sure none of these are your cause, try the same on a completely new page. The expected result of your code and selecting a page UID, is exactly the value 60 - nothing more, nothing less.

2) You may find it easier to use a ###STORAGE_PID### marker in your foreign_table_where and selecting the page(s) allowed for content selection, as values in the Behavior tab when editing your content element or page. This value has the added benefit of being possible to allow only for certain users or usergroups, or admins only.

Claus Due
  • 4,166
  • 11
  • 23