子页面菜单-获取字段子标题而不是nav_title

问题描述 投票:0回答:1

感谢您提供以下问题的支持:在过去(在FLUID之前),对于带有子页面的菜单的[:

,可以提取字段字幕的值而不是nav_title
tt_content.menu.20.1.1.NO {   
    stdWrap.cObject = COA
    stdWrap.cObject {
      10 = TEXT
      10.field = subtitle // nav_title
    }    
}

使用FLUID如何获得相同的结果?我已经尝试过:

tt_content.menu_subpages.dataProcessing {
  10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
  10.titleField = subtitle // nav_title
}

tt_content.menu_subpages.dataProcessing.10.titleField = subtitle // nav_title

但无法解决。输出仍然是默认的nav_title(尽管所有子页面的字段副标题have一个值)

感谢支持!

typo3 typoscript submenu fluid
1个回答
0
投票
查看您的fluid模板。在那里,您可以访问整个pages记录。

您需要的是类似的东西:

{f:if(condition:page.subtitle, then:page.subtitle, else:page.nav_title)}

或:

{f:if(condition:page.subtitle, then:page.subtitle, else:'{f:if(condition:page.nav_title, then:page.nav_title, else:page.title)}')}

© www.soinside.com 2019 - 2024. All rights reserved.