MarioProject
MarioProject

Reputation: 427

TYPO3 Fluid Viewhelper Content of First Subpage

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?

Upvotes: 0

Views: 1430

Answers (1)

stmllr
stmllr

Reputation: 652

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

Upvotes: 3

Related Questions