Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
572 views
in Technique[技术] by (71.8m points)

typoscript - TYPO3 Menu with categories?

How can I add the categories to each page of my menu element?

I have been trying different combinations of DatabaseQueryProcessor but the array comes through empty.

This is what I currently have based on other examples:

dataProcessing {
        10 = TYPO3CMSFrontendDataProcessingMenuProcessor
        10 {
             special = list
             special.value.field = pages
             levels = 2
             as = menuItems
             expandAll = 1
             includeNotInMenu = 1
             titleField = nav_title // title
             dataProcessing {
                 10 = TYPO3CMSFrontendDataProcessingFilesProcessor
                 10 {
                     references.fieldName = media
                 }
                 20 = TYPO3CMSFrontendDataProcessingDatabaseQueryProcessor
                 20 {
                        if.isTrue.field = categories
                        table = sys_category
                        pidInList = root,-1
                        selectFields = sys_category.*
                        where.data = field:_ORIG_uid // field:uid
                        as = categories
                 }
             }
        }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The pidInList needs to be the page where the categories are stored.

20 = TYPO3CMSFrontendDataProcessingDatabaseQueryProcessor
20 {
        if.isTrue.field = categories
        table = sys_category
        selectFields = sys_category.*
        pidInList = 55
        recursive = 999
        join = sys_category_record_mm ON sys_category_record_mm.uid_local = sys_category.uid
        where.data = field:_ORIG_uid // field:uid
        where.intval = 1
        where.wrap = sys_category_record_mm.uid_foreign=|
        as = categories
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...