TYPO3 DataProcessing extract tt_content in a menu

I search for a TYPO3 TypoScript solution with a DataProcessing to build the menu and a part of tt_content in the colPos=0

110 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
110 {
    special = directory
    special.value = 41
    levels = 9
    includeSpacer = 0
    as = placesnavigation
    titleField = nav_title // title

    dataProcessing {
        20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
        20 {
            table = tt_content
            orderBy = sorting
            where = colPos = 0
            as = placesInfoContent
        }
    }
}

But it works only from the active page and all pages get the same content.


you need to tell your DatabaseQueryProcessor on which page it is. With the current query you get all content elements of all pages.

Try:

110 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
110 {
                special = directory
                special.value = 41
                levels = 9
                includeSpacer = 0
                as = placesnavigation
                titleField = nav_title // title
                
                expandAll = 1

                dataProcessing {
                    20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
                    20 {
                        table = tt_content
                        orderBy = sorting
                        where {
                          data = field:uid
                          wrap = colPos = 0 AND pid = |
                        }
                        as = placesInfoContent
                    }
                }
            }

This takes the current page uid and adds it to the where condition of your content query.


Try this modified version, since there is no need to use the wrap within the query settings:

110 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
110 {
  special = directory
  special.value = 41
  levels = 9
  includeSpacer = 0
  as = placesnavigation
  titleField = nav_title // title
  expandAll = 1
  dataProcessing {
    20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
    20 {
      table = tt_content
      pidInList.field = uid
      orderBy = sorting
      as = placesInfoContent
    }
  }
}