TYPO3 引导程序包部分菜单不适用于新闻

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

我正在努力处理 TYPO3 v12(基于作曲家)的 bootstrap-package 中的 MenuSection 内容元素。在新闻详细信息页面上,我有一个 MenuSection 内容元素,它不会呈现新闻文章的部分。相反,它呈现页面本身的标题(无)。我所知道的是,内容元素没有实现该功能,但我找不到任何解决方案来解决新闻文章的问题。

我发现 MenuSection 文件可能根本无法做到这一点。

供应商/bk2k/bootstrap-package/Configuration/TypoScript/ContentElement/Element/MenuSection.typoscript

tt_content.menu_section >
# CTYPE: MENU SECTION INDEX
tt_content.menu_section =< lib.contentElement
tt_content.menu_section {
    templateName = MenuSection
    dataProcessing {
        10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
        10 {
            special = list
            special {
                value {
                    field = pages
                    override {
                        data = page:uid
                        if {
                            isFalse.field = pages
                        }
                    }
                }
            }
            includeNotInMenu = 1
            dataProcessing {
                10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
                10 {
                    references.fieldName = media
                }
                20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
                20 {
                    table = tt_content
                    pidInList.field = uid
                    as = content
                    where = sectionIndex = 1
                    orderBy = sorting
                    dataProcessing {
                        10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
                        10 {
                            references.fieldName = image
                        }
                    }
                }
            }
        }
        90 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
        90 {
            if {
                isTrue.field = accessibility_bypass
            }
            table = tt_content
            pidInList = this
            orderBy = sorting
            max = 1
            where {
                dataWrap = colPos = {field:colPos} AND sorting > {field:sorting}
            }
            as = nextContentElement
        }
    }
}

我认为当页面上当前显示新闻时覆盖该内容元素可能是诀窍。我到处搜索,但似乎没有人需要这个。

[traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0]
  tt_content.menu_section {
      dataProcessing {
          10 {
              special = list
              special {
                value {
                    # and somewhere here I need to change it to the currently selected news item and the referencing tx_news_domain_model_news
                    field = pages
                    override {
                        data = page:uid
                        if {
                            isFalse.field = pages
                        }
                    }
                }
              }
              dataProcessing {
                  20 {
                      # somewhere here with the referenced tx_news_domain_model_news_ttcontent_mm
                      table = tt_content
                      pidInList.field = uid
                      as = content
                      where = sectionIndex = 1
                      orderBy = sorting
                  }
              }
          }
      }
  }


[global]

有人解决这个问题了吗?

typo3 typoscript
1个回答
0
投票

您想要新闻项目菜单吗?尝试“新闻”类型的内容元素,它具有高度可配置性,并且具有一些开箱即用的菜单版本。

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