Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 311
User__42 Avatar asked Dec 11 '25 14:12

User__42


2 Answers

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
            }
        }
    }
}
like image 88
Thomas Löffler Avatar answered Dec 14 '25 08:12

Thomas Löffler


First, the "dataProcessing" has to be done inside page.10. And second you have to give your arguments over to your section in the "f:render" tag. Don't know if you do that, because that part is missing in your example code.

like image 34
tobi Avatar answered Dec 14 '25 07:12

tobi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!