Search code examples
typo3typoscriptfluidtypo3-8.7.x

Using the Dataprocessor from TYPO3 8


I try to use the dataprocessor from TYPO3 8 to make my menu.

I have this code in my TypoScript script:

page = PAGE
page{
  10 = FLUIDTEMPLATE
  10 {
      file = fileadmin/abis/templates/BootstrapTmpl.html
      partialRootPath = fileadmin/abis/Partials/
      layoutRootPath =  fileadmin/abis/Layouts/
  }
  dataProcessing {
    10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
    10 {
      entryLevel= 0
      excludeUidList = 27,30,31
      levels = 5
      #includeSpacer = 1
      titleField = nav_title // title
      as = huhu
    }
  }
  ...
}

And this one in a section:

<f:section name="myMenu" >
    <f:debug title="title">{huhu}</f:debug>
    <f:cObject typoscriptObjectPath="obj.logo" />
    <ul class="nav navbar-nav navbar-left">
        <f:for each="{huhu}" as="menuItem">
             <li>
                {menuItem.text}
                <f:if condition="menuItem.subItems">
                    <f:render section="myMenu" arguments="{myMenu: menuItem.subItems}" />
                </f:if>
            </li>
        </f:for>
    </ul>
</f:section>

My HTML output is empty. The variable {huhu} is empty. And I don't know why. Does anybody have an idea?


Solution

  • Try to put your dataProcessing into page.10:

    page = PAGE
    page {
        10 = FLUIDTEMPLATE
        10 {
            file = fileadmin/abis/templates/BootstrapTmpl.html
            partialRootPath = fileadmin/abis/Partials/
            layoutRootPath =  fileadmin/abis/Layouts/
    
            dataProcessing {
                10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
                10 {
                    entryLevel= 0
                    excludeUidList = 27,30,31
                    levels = 5
                    #includeSpacer = 1
                    titleField = nav_title // title
                    as = huhu
                }
            }
        }
    }