0

I created a content to show the content of subpages.

<v:page.menu  pageUid="{page.uid}" levels="2">
         <f:for each="{menu}" as="item">
                <v:content.render pageUid="{item.uid}" column="0"/>
         </f:for>       
</v:page.menu>

It works!

Is there a way to get only the content of the first subpage?

Georg Ringer
  • 7,779
  • 1
  • 16
  • 34
MarioProject
  • 417
  • 4
  • 25

1 Answers1

3

Use iterator in <f:for>:

<v:page.menu pageUid="{page.uid}" levels="2">
    <f:for each="{menu}" as="item" iteration="iterator">
        <f:if condition="{iterator.isFirst}">
            <v:content.render pageUid="{item.uid}" column="0"/>
        </f:if>
    </f:for>       
</v:page.menu>

https://docs.typo3.org/typo3cms/ExtbaseGuide/Fluid/ViewHelper/For.html#example-with-iterator-information

stmllr
  • 652
  • 3
  • 18