JIM
JIM

Reputation: 500

TYPO3 bootstrap-package SectionMenu not working for news

I am struggling with the MenuSection content element from the bootstrap-package for TYPO3 v12 (composer-based). On the news detail page I have a MenuSection content element that does not render the sections of the news article. Instead it renders the headings of the page itself (none). What I know is, that the content element does not implement that feature, but I cant find any solutions how to fix that for a news article.

What I figured out is that the MenuSection file might not be able to do that at all.

vendor/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
        }
    }
}

I think overwriting that content element when there is a news currently shown on the page might be the trick. I searched everywhere but it seems like no one else ever needed that.

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

Did anyone solve that problem yet?

Upvotes: 0

Views: 119

Answers (1)

die Tante Jensen
die Tante Jensen

Reputation: 21

You want a menu of the news-items? Try a content-element of the type "news", it's highly configurable and has some out of the box menu versions.

Upvotes: 0

Related Questions