Search code examples
fluidextbasetypo3-9.x

TYPO render section inside a section


I am trying to place the logo in the middle of my navigation.

<f:section name="MainNavigation">
<f:if condition="{menu}">
    <ul class="navbar-nav">
        <f:for each="{menu}" as="item">
            <f:if condition="{item.spacer}">
                <f:then>
                    </ul>
                        <f:render section="MainNavigationLogo" arguments="{_all}" />
                    <ul class="navbar-nav">
                </f:then>
                <f:else>

The menu is splitting up, but the logo doesn't show up. I think it is because that {_all} does not contain the right information.

The MainNavigation is rendered this way

<f:render section="MainNavigation" arguments="{menu: mainnavigation, theme: theme}" />

How can I render af section inside another section in TYPO3?


Solution

  • There are no restriction to calls of sections in sections. But you need to provide the neccessary data.

    As you wrote your prime section call just got two variables menu and theme, so other variables are not know inside the section, and could not be transfered any further.

    You can test your set of variables by inserting this viewhelper call at different lines of your template:

    <f:debug titel="identify this call">{_all}</f:debug>
    

    Use the title attribute to provide a unique identifier of this debug code.

    You might need to add another variable to your primary call so the infrmation also is available in your MainNavigationLogo section.