typo3 - 使用 TYPO3 中的数据处理器 8

标签 typo3 typoscript fluid typo3-8.7.x

我尝试使用 TYPO3 8 的数据处理器来制作我的菜单。

我的 TypoScript 脚本中有这段代码:

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
    }
  }
  ...
}

这是一个部分:

<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>

我的 HTML 输出是空的。变量 {huhu} 为空。我不知道为什么。有人有想法吗?

最佳答案

尝试将您的数据处理放入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
            }
        }
    }
}

关于typo3 - 使用 TYPO3 中的数据处理器 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46451686/

相关文章:

typo3 - 如何覆盖后端流体模板?

TYPO3 数据库查询处理器 : Multiple Outputs of same UIDs

fluid - Typo3 流体 : elseif inline notation

ssl - HTTPS 产生后端问题

typo3 - 如何在流体中分配变量?

forms - 如何使用 TypoScript 覆盖 TYPO3 表单框架的 YAML 设置?

mapping - extbase 映射到现有表不起作用

css - 将固定 div 内的流体宽度 div 居中以固定到视口(viewport)顶部

css - 具有固定边距的响应式/流体 4 列

database - TYPO3 Extbase 中的内连接