0
votes

In TYPO3 10.4.8 I have the following page tree:

root

1level: Events

2level: Event A, Event B, Event C, ... and so ...

What I want to do in page Events is to render all subpages title, using FLUIDTEMPLATE.

So in the template of page Events I wrote

lib.EventContent = COA
lib.EventContent {
    10 = COA
    10{
        table = pages
        select {
            orderBy = sorting
            pidInList = this
        }
    }
}

and in the layout file

<f:for each="lib.EventContent" as="event" >
    <p>event: {event.title}</p>
</f:for>

This doesn't work. Typo give me this error:

The argument "each" was registered with type "array", but is of type "string" in view helper "TYPO3Fluid\Fluid\ViewHelpers\ForViewHelper".

In addition, I also tried to change COA with CONTENT, in all possible combination (COA-CONTENT / CONTENT-COA / CONTENT-CONTENT) What's wrong? is something that I cannot do?

Thanks all

1

1 Answers

1
votes

The TypoScript should look something like this:

lib.EventContent = CONTENT
lib.EventContent {
    table = pages
    select {
      orderBy = sorting
      pidInList = this
    }
}

But there is a much easier solution. TYPO3 already brings a content element "Subpages" which renders a menu of all subpages of a selected page:

enter image description here

This is done via Fluid Styled Content and TypoScript. Please check this file for details: typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/MenuSubpages.typoscript

A solution for you might look like this (untested):

lib.EventContent < tt_content.menu_subpages
lib.EventContent {
  dataProcessing {
    10 {
      special >
    }
  }
}

It's also a good idea to have a look in all the TypoScript files in the Fluid Styled Content extension to get more inspiration.